schlechtenburg/docs/assets/index.863ba482.js.map

1 line
375 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"index.863ba482.js","sources":["../../vite/dynamic-import-polyfill","../../packages/core/lib/use-dynamic-blocks.ts","../../packages/core/lib/components/Block.tsx","../../packages/core/lib/components/Main.tsx","../../vite/preload-helper","../../packages/paragraph/node_modules/@vue/shared/dist/shared.esm-bundler.js","../../packages/paragraph/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../packages/paragraph/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../packages/paragraph/lib/util.ts","../../packages/paragraph/lib/index.ts","../../src/main.ts","../../src/App.tsx"],"sourcesContent":["const p = function polyfill(modulePath = '.', importFunctionName = '__import__') {\n try {\n self[importFunctionName] = new Function('u', `return import(u)`);\n }\n catch (error) {\n const baseURL = new URL(modulePath, location);\n const cleanup = (script) => {\n URL.revokeObjectURL(script.src);\n script.remove();\n };\n self[importFunctionName] = (url) => new Promise((resolve, reject) => {\n const absURL = new URL(url, baseURL);\n // If the module has already been imported, resolve immediately.\n if (self[importFunctionName].moduleMap[absURL]) {\n return resolve(self[importFunctionName].moduleMap[absURL]);\n }\n const moduleBlob = new Blob([\n `import * as m from '${absURL}';`,\n `${importFunctionName}.moduleMap['${absURL}']=m;`\n ], { type: 'text/javascript' });\n const script = Object.assign(document.createElement('script'), {\n type: 'module',\n src: URL.createObjectURL(moduleBlob),\n onerror() {\n reject(new Error(`Failed to import: ${url}`));\n cleanup(script);\n },\n onload() {\n resolve(self[importFunctionName].moduleMap[absURL]);\n cleanup(script);\n }\n });\n document.head.appendChild(script);\n });\n self[importFunctionName].moduleMap = {};\n }\n};__VITE_IS_MODERN__&&p(\"assets/\");","import {\n inject,\n reactive,\n} from 'vue';\nimport { BlockLibrary } from './types';\n\nexport const SymBlockLibrary = Symbol('Schlechtenburg block library');\nexport function useDynamicBlocks() {\n const customBlocks: BlockLibrary = inject(SymBlockLibrary, reactive({}));\n const getBlock = (name: string) => customBlocks[name];\n\n return {\n customBlocks,\n getBlock,\n };\n}\n","import {\n defineComponent,\n computed,\n PropType,\n ref,\n Ref,\n} from 'vue';\nimport { BlockData } from '../types';\nimport { useDynamicBlocks } from '../use-dynamic-blocks';\n\nimport './Block.scss';\n\nexport const SbBlock = defineComponent({\n name: 'sb-block',\n\n props: {\n block: {\n type: (null as unknown) as PropType<BlockData<any>>,\n required: true,\n },\n },\n\n setup(props, context) {\n const el: Ref<null|HTMLElement> = ref(null);\n const { getBlock } = useDynamicBlocks();\n const classes = computed(() => ({ 'sb-block': true }));\n\n return () => {\n const BlockComponent = getBlock(props.block.name)?.component as any;\n\n return <div\n ref={el}\n class={classes.value}\n >\n <BlockComponent\n data={props.block.data}\n blockId={props.block.id}\n {...context.attrs}\n />\n </div>;\n };\n },\n});\n","import {\n defineComponent,\n provide,\n shallowReactive,\n ref,\n PropType,\n} from 'vue';\nimport {\n BlockData,\n BlockDefinition,\n BlockLibrary,\n} from '../types';\nimport { SymBlockLibrary} from '../use-dynamic-blocks';\n\nimport { SbBlock } from './Block';\n\nimport './Main.scss';\n\nexport const SbMain = defineComponent({\n name: 'sb-main',\n\n model: {\n prop: 'block',\n event: 'update',\n },\n\n props: {\n customBlocks: {\n type: Array as PropType<BlockDefi