nebula-cms 0.1.0 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/astro/index.d.ts +43 -0
- package/dist/astro/index.d.ts.map +1 -0
- package/dist/astro/index.js +223 -0
- package/dist/client/Admin.svelte.d.ts +11 -0
- package/dist/client/Admin.svelte.d.ts.map +1 -0
- package/dist/client/components/BackendPicker.svelte.d.ts +4 -0
- package/dist/client/components/BackendPicker.svelte.d.ts.map +1 -0
- package/dist/client/components/DraftChip.svelte.d.ts +10 -0
- package/dist/client/components/DraftChip.svelte.d.ts.map +1 -0
- package/dist/client/components/MetadataForm.svelte.d.ts +12 -0
- package/dist/client/components/MetadataForm.svelte.d.ts.map +1 -0
- package/dist/client/components/ThemeToggle.svelte.d.ts +19 -0
- package/dist/client/components/ThemeToggle.svelte.d.ts.map +1 -0
- package/dist/client/components/dialogs/DeleteDraftDialog.svelte.d.ts +11 -0
- package/dist/client/components/dialogs/DeleteDraftDialog.svelte.d.ts.map +1 -0
- package/dist/client/components/dialogs/FilenameDialog.svelte.d.ts +13 -0
- package/dist/client/components/dialogs/FilenameDialog.svelte.d.ts.map +1 -0
- package/dist/client/components/editor/EditorPane.svelte.d.ts +4 -0
- package/dist/client/components/editor/EditorPane.svelte.d.ts.map +1 -0
- package/dist/client/components/editor/EditorTabs.svelte.d.ts +8 -0
- package/dist/client/components/editor/EditorTabs.svelte.d.ts.map +1 -0
- package/dist/client/components/editor/EditorToolbar.svelte.d.ts +4 -0
- package/dist/client/components/editor/EditorToolbar.svelte.d.ts.map +1 -0
- package/dist/client/components/editor/FormatSelector.svelte.d.ts +4 -0
- package/dist/client/components/editor/FormatSelector.svelte.d.ts.map +1 -0
- package/dist/client/components/editor/Toolbar.svelte.d.ts +19 -0
- package/dist/client/components/editor/Toolbar.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/ArrayField.svelte.d.ts +15 -0
- package/dist/client/components/fields/ArrayField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/ArrayItem.svelte.d.ts +28 -0
- package/dist/client/components/fields/ArrayItem.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/BooleanField.svelte.d.ts +16 -0
- package/dist/client/components/fields/BooleanField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/DateField.svelte.d.ts +16 -0
- package/dist/client/components/fields/DateField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/EnumField.svelte.d.ts +17 -0
- package/dist/client/components/fields/EnumField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/FieldWrapper.svelte.d.ts +18 -0
- package/dist/client/components/fields/FieldWrapper.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/NumberField.svelte.d.ts +16 -0
- package/dist/client/components/fields/NumberField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/ObjectField.svelte.d.ts +16 -0
- package/dist/client/components/fields/ObjectField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/SchemaField.svelte.d.ts +16 -0
- package/dist/client/components/fields/SchemaField.svelte.d.ts.map +1 -0
- package/dist/client/components/fields/StringField.svelte.d.ts +16 -0
- package/dist/client/components/fields/StringField.svelte.d.ts.map +1 -0
- package/dist/client/components/sidebar/AdminSidebar.svelte.d.ts +19 -0
- package/dist/client/components/sidebar/AdminSidebar.svelte.d.ts.map +1 -0
- package/dist/client/components/sidebar/AdminSidebarSort.svelte.d.ts +12 -0
- package/dist/client/components/sidebar/AdminSidebarSort.svelte.d.ts.map +1 -0
- package/dist/client/css/icons.css +29 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/js/drafts/merge.svelte.d.ts +24 -0
- package/dist/client/js/drafts/merge.svelte.d.ts.map +1 -0
- package/dist/client/js/drafts/merge.svelte.js +106 -0
- package/dist/client/js/drafts/ops.svelte.d.ts +31 -0
- package/dist/client/js/drafts/ops.svelte.d.ts.map +1 -0
- package/dist/client/js/drafts/ops.svelte.js +182 -0
- package/dist/client/js/drafts/storage.d.ts +45 -0
- package/dist/client/js/drafts/storage.d.ts.map +1 -0
- package/dist/client/js/drafts/storage.js +76 -0
- package/dist/client/js/drafts/workers/diff.d.ts +2 -0
- package/dist/client/js/drafts/workers/diff.d.ts.map +1 -0
- package/dist/client/js/drafts/workers/diff.js +20 -0
- package/dist/client/js/editor/editor.svelte.d.ts +124 -0
- package/dist/client/js/editor/editor.svelte.d.ts.map +1 -0
- package/dist/client/js/editor/editor.svelte.js +294 -0
- package/dist/client/js/editor/languages.d.ts +11 -0
- package/dist/client/js/editor/languages.d.ts.map +1 -0
- package/dist/client/js/editor/languages.js +93 -0
- package/dist/client/js/editor/link-wrap.d.ts +6 -0
- package/dist/client/js/editor/link-wrap.d.ts.map +1 -0
- package/{src/client/js/editor/link-wrap.ts → dist/client/js/editor/link-wrap.js} +17 -24
- package/dist/client/js/editor/markdown-shortcuts.d.ts +4 -0
- package/dist/client/js/editor/markdown-shortcuts.d.ts.map +1 -0
- package/dist/client/js/editor/markdown-shortcuts.js +219 -0
- package/dist/client/js/handlers/admin.d.ts +64 -0
- package/dist/client/js/handlers/admin.d.ts.map +1 -0
- package/dist/client/js/handlers/admin.js +186 -0
- package/dist/client/js/state/dialogs.svelte.d.ts +16 -0
- package/dist/client/js/state/dialogs.svelte.d.ts.map +1 -0
- package/dist/client/js/state/dialogs.svelte.js +28 -0
- package/dist/client/js/state/router.svelte.d.ts +44 -0
- package/dist/client/js/state/router.svelte.d.ts.map +1 -0
- package/dist/client/js/state/router.svelte.js +135 -0
- package/dist/client/js/state/schema.svelte.d.ts +51 -0
- package/dist/client/js/state/schema.svelte.d.ts.map +1 -0
- package/{src/client/js/state/schema.svelte.ts → dist/client/js/state/schema.svelte.js} +55 -70
- package/dist/client/js/state/state.svelte.d.ts +68 -0
- package/dist/client/js/state/state.svelte.d.ts.map +1 -0
- package/dist/client/js/state/state.svelte.js +291 -0
- package/dist/client/js/state/theme.svelte.d.ts +24 -0
- package/dist/client/js/state/theme.svelte.d.ts.map +1 -0
- package/{src/client/js/state/theme.svelte.ts → dist/client/js/state/theme.svelte.js} +54 -91
- package/dist/client/js/storage/adapter.d.ts +130 -0
- package/dist/client/js/storage/adapter.d.ts.map +1 -0
- package/dist/client/js/storage/adapter.js +5 -0
- package/dist/client/js/storage/client.d.ts +72 -0
- package/dist/client/js/storage/client.d.ts.map +1 -0
- package/dist/client/js/storage/client.js +121 -0
- package/dist/client/js/storage/db.d.ts +8 -0
- package/dist/client/js/storage/db.d.ts.map +1 -0
- package/dist/client/js/storage/db.js +35 -0
- package/dist/client/js/storage/fsa.d.ts +51 -0
- package/dist/client/js/storage/fsa.d.ts.map +1 -0
- package/dist/client/js/storage/fsa.js +91 -0
- package/dist/client/js/storage/github.d.ts +62 -0
- package/dist/client/js/storage/github.d.ts.map +1 -0
- package/dist/client/js/storage/github.js +216 -0
- package/dist/client/js/storage/storage.d.ts +32 -0
- package/dist/client/js/storage/storage.d.ts.map +1 -0
- package/dist/client/js/storage/storage.js +68 -0
- package/dist/client/js/storage/workers/frontmatter.d.ts +2 -0
- package/dist/client/js/storage/workers/frontmatter.d.ts.map +1 -0
- package/dist/client/js/storage/workers/frontmatter.js +253 -0
- package/dist/client/js/storage/workers/storage.d.ts +2 -0
- package/dist/client/js/storage/workers/storage.d.ts.map +1 -0
- package/dist/client/js/storage/workers/storage.js +167 -0
- package/dist/client/js/storage/workers/toml-parser.d.ts +2 -0
- package/dist/client/js/storage/workers/toml-parser.d.ts.map +1 -0
- package/dist/client/js/storage/workers/toml-parser.js +75 -0
- package/dist/client/js/storage/workers/yaml-parser.d.ts +2 -0
- package/dist/client/js/storage/workers/yaml-parser.d.ts.map +1 -0
- package/dist/client/js/storage/workers/yaml-parser.js +100 -0
- package/dist/client/js/utils/file-types.d.ts +58 -0
- package/dist/client/js/utils/file-types.d.ts.map +1 -0
- package/{src/client/js/utils/file-types.ts → dist/client/js/utils/file-types.js} +75 -107
- package/dist/client/js/utils/format.d.ts +8 -0
- package/dist/client/js/utils/format.d.ts.map +1 -0
- package/{src/client/js/utils/format.ts → dist/client/js/utils/format.js} +5 -6
- package/dist/client/js/utils/frontmatter.d.ts +12 -0
- package/dist/client/js/utils/frontmatter.d.ts.map +1 -0
- package/dist/client/js/utils/frontmatter.js +29 -0
- package/dist/client/js/utils/schema-utils.d.ts +110 -0
- package/dist/client/js/utils/schema-utils.d.ts.map +1 -0
- package/dist/client/js/utils/schema-utils.js +242 -0
- package/dist/client/js/utils/slug.d.ts +8 -0
- package/dist/client/js/utils/slug.d.ts.map +1 -0
- package/{src/client/js/utils/slug.ts → dist/client/js/utils/slug.js} +6 -7
- package/dist/client/js/utils/sort.d.ts +41 -0
- package/dist/client/js/utils/sort.d.ts.map +1 -0
- package/dist/client/js/utils/sort.js +65 -0
- package/dist/client/js/utils/stable-stringify.d.ts +8 -0
- package/dist/client/js/utils/stable-stringify.d.ts.map +1 -0
- package/dist/client/js/utils/stable-stringify.js +23 -0
- package/dist/client/js/utils/url-utils.d.ts +11 -0
- package/dist/client/js/utils/url-utils.d.ts.map +1 -0
- package/{src/client/js/utils/url-utils.ts → dist/client/js/utils/url-utils.js} +22 -23
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -42
- package/.github/workflows/ci.yml +0 -31
- package/.mcp.json +0 -12
- package/.prettierignore +0 -5
- package/.prettierrc.cjs +0 -22
- package/AGENTS.md +0 -183
- package/playground/.claude/settings.local.json +0 -5
- package/playground/astro.config.mjs +0 -7
- package/playground/node_modules/.bin/astro +0 -21
- package/playground/node_modules/.bin/rollup +0 -21
- package/playground/node_modules/.bin/tsc +0 -21
- package/playground/node_modules/.bin/tsserver +0 -21
- package/playground/node_modules/.bin/vite +0 -21
- package/playground/node_modules/.vite/_svelte_metadata.json +0 -1
- package/playground/node_modules/.vite/deps/@astrojs_svelte_client__js.js +0 -80
- package/playground/node_modules/.vite/deps/@astrojs_svelte_client__js.js.map +0 -7
- package/playground/node_modules/.vite/deps/_metadata.json +0 -184
- package/playground/node_modules/.vite/deps/astro___aria-query.js +0 -6776
- package/playground/node_modules/.vite/deps/astro___aria-query.js.map +0 -7
- package/playground/node_modules/.vite/deps/astro___axobject-query.js +0 -3754
- package/playground/node_modules/.vite/deps/astro___axobject-query.js.map +0 -7
- package/playground/node_modules/.vite/deps/astro___html-escaper.js +0 -34
- package/playground/node_modules/.vite/deps/astro___html-escaper.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-AJXJMYAF.js +0 -0
- package/playground/node_modules/.vite/deps/chunk-AJXJMYAF.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-ALJIOON6.js +0 -1005
- package/playground/node_modules/.vite/deps/chunk-ALJIOON6.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
- package/playground/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-CNYJBM5F.js +0 -21
- package/playground/node_modules/.vite/deps/chunk-CNYJBM5F.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-DBPNBGEI.js +0 -223
- package/playground/node_modules/.vite/deps/chunk-DBPNBGEI.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-G3C2FXJT.js +0 -204
- package/playground/node_modules/.vite/deps/chunk-G3C2FXJT.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-GKDKFWC5.js +0 -27
- package/playground/node_modules/.vite/deps/chunk-GKDKFWC5.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-HNCLEOC5.js +0 -4376
- package/playground/node_modules/.vite/deps/chunk-HNCLEOC5.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-JICYXBFU.js +0 -688
- package/playground/node_modules/.vite/deps/chunk-JICYXBFU.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-KCUTL6DD.js +0 -5099
- package/playground/node_modules/.vite/deps/chunk-KCUTL6DD.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-ZP4UNCSN.js +0 -23
- package/playground/node_modules/.vite/deps/chunk-ZP4UNCSN.js.map +0 -7
- package/playground/node_modules/.vite/deps/chunk-ZREFNRZZ.js +0 -148
- package/playground/node_modules/.vite/deps/chunk-ZREFNRZZ.js.map +0 -7
- package/playground/node_modules/.vite/deps/package.json +0 -3
- package/playground/node_modules/.vite/deps/smol-toml.js +0 -843
- package/playground/node_modules/.vite/deps/smol-toml.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte.js +0 -55
- package/playground/node_modules/.vite/deps/svelte.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte___clsx.js +0 -9
- package/playground/node_modules/.vite/deps/svelte___clsx.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_animate.js +0 -57
- package/playground/node_modules/.vite/deps/svelte_animate.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_attachments.js +0 -15
- package/playground/node_modules/.vite/deps/svelte_attachments.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_easing.js +0 -67
- package/playground/node_modules/.vite/deps/svelte_easing.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_events.js +0 -11
- package/playground/node_modules/.vite/deps/svelte_events.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal.js +0 -5
- package/playground/node_modules/.vite/deps/svelte_internal.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal_client.js +0 -402
- package/playground/node_modules/.vite/deps/svelte_internal_client.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal_disclose-version.js +0 -10
- package/playground/node_modules/.vite/deps/svelte_internal_disclose-version.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal_flags_async.js +0 -8
- package/playground/node_modules/.vite/deps/svelte_internal_flags_async.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal_flags_legacy.js +0 -8
- package/playground/node_modules/.vite/deps/svelte_internal_flags_legacy.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_internal_flags_tracing.js +0 -8
- package/playground/node_modules/.vite/deps/svelte_internal_flags_tracing.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_legacy.js +0 -35
- package/playground/node_modules/.vite/deps/svelte_legacy.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_motion.js +0 -545
- package/playground/node_modules/.vite/deps/svelte_motion.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_reactivity.js +0 -29
- package/playground/node_modules/.vite/deps/svelte_reactivity.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_reactivity_window.js +0 -127
- package/playground/node_modules/.vite/deps/svelte_reactivity_window.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_store.js +0 -103
- package/playground/node_modules/.vite/deps/svelte_store.js.map +0 -7
- package/playground/node_modules/.vite/deps/svelte_transition.js +0 -208
- package/playground/node_modules/.vite/deps/svelte_transition.js.map +0 -7
- package/playground/package.json +0 -16
- package/playground/pnpm-lock.yaml +0 -3167
- package/playground/src/content/authors/jane-doe.json +0 -8
- package/playground/src/content/config/build.toml +0 -2
- package/playground/src/content/courses/web-fundamentals.json +0 -29
- package/playground/src/content/docs/advanced.mdx +0 -6
- package/playground/src/content/docs/intro.md +0 -6
- package/playground/src/content/guides/getting-started.mdx +0 -6
- package/playground/src/content/posts/hello-world.md +0 -7
- package/playground/src/content/products/t-shirt.json +0 -16
- package/playground/src/content/recipes/pancakes.mdoc +0 -8
- package/playground/src/content/settings/site.yml +0 -2
- package/playground/src/content.config.ts +0 -198
- package/playground/src/env.d.ts +0 -1
- package/playground/src/pages/index.astro +0 -11
- package/playground/src/pages/nebula.astro +0 -14
- package/pnpm-workspace.yaml +0 -2
- package/scripts/subset-icons.mjs +0 -178
- package/src/astro/index.ts +0 -295
- package/src/client/js/drafts/merge.svelte.ts +0 -121
- package/src/client/js/drafts/ops.svelte.ts +0 -227
- package/src/client/js/drafts/storage.ts +0 -108
- package/src/client/js/drafts/workers/diff.ts +0 -40
- package/src/client/js/editor/editor.svelte.ts +0 -343
- package/src/client/js/editor/languages.ts +0 -98
- package/src/client/js/editor/markdown-shortcuts.ts +0 -261
- package/src/client/js/handlers/admin.ts +0 -246
- package/src/client/js/state/dialogs.svelte.ts +0 -35
- package/src/client/js/state/router.svelte.ts +0 -156
- package/src/client/js/state/state.svelte.ts +0 -334
- package/src/client/js/storage/adapter.ts +0 -102
- package/src/client/js/storage/client.ts +0 -150
- package/src/client/js/storage/db.ts +0 -36
- package/src/client/js/storage/fsa.ts +0 -110
- package/src/client/js/storage/github.ts +0 -297
- package/src/client/js/storage/storage.ts +0 -83
- package/src/client/js/storage/workers/frontmatter.ts +0 -320
- package/src/client/js/storage/workers/storage.ts +0 -177
- package/src/client/js/storage/workers/toml-parser.ts +0 -106
- package/src/client/js/storage/workers/yaml-parser.ts +0 -132
- package/src/client/js/utils/frontmatter.ts +0 -38
- package/src/client/js/utils/schema-utils.ts +0 -295
- package/src/client/js/utils/sort.ts +0 -84
- package/src/client/js/utils/stable-stringify.ts +0 -27
- package/src/types.ts +0 -25
- package/svelte.config.js +0 -4
- package/tests/astro/build.test.ts +0 -63
- package/tests/astro/index.test.ts +0 -689
- package/tests/client/components/Admin.test.ts +0 -446
- package/tests/client/components/BackendPicker.test.ts +0 -239
- package/tests/client/components/DraftChip.test.ts +0 -53
- package/tests/client/components/MetadataForm.test.ts +0 -164
- package/tests/client/components/dialogs/DeleteDraftDialog.test.ts +0 -91
- package/tests/client/components/dialogs/FilenameDialog.test.ts +0 -209
- package/tests/client/components/dialogs/dialog-stubs.ts +0 -19
- package/tests/client/components/editor/EditorPane.test.ts +0 -100
- package/tests/client/components/editor/EditorTabs.test.ts +0 -253
- package/tests/client/components/editor/EditorToolbar.test.ts +0 -252
- package/tests/client/components/editor/fixtures.ts +0 -31
- package/tests/client/components/fields/ArrayField.test.ts +0 -197
- package/tests/client/components/fields/BooleanField.test.ts +0 -206
- package/tests/client/components/fields/DateField.test.ts +0 -210
- package/tests/client/components/fields/EnumField.test.ts +0 -246
- package/tests/client/components/fields/NumberField.test.ts +0 -240
- package/tests/client/components/fields/ObjectField.test.ts +0 -157
- package/tests/client/components/fields/SchemaField.test.ts +0 -190
- package/tests/client/components/fields/StringField.test.ts +0 -223
- package/tests/client/components/sidebar/AdminSidebar.test.ts +0 -285
- package/tests/client/components/sidebar/AdminSidebarSort.test.ts +0 -135
- package/tests/client/components/sidebar/sort-mock.ts +0 -23
- package/tests/client/js/drafts/fixtures.ts +0 -22
- package/tests/client/js/drafts/merge.test.ts +0 -282
- package/tests/client/js/drafts/ops.test.ts +0 -658
- package/tests/client/js/drafts/storage.test.ts +0 -200
- package/tests/client/js/drafts/workers/diff.test.ts +0 -165
- package/tests/client/js/editor/editor.test.ts +0 -616
- package/tests/client/js/editor/link-wrap.test.ts +0 -225
- package/tests/client/js/editor/markdown-shortcuts.test.ts +0 -370
- package/tests/client/js/handlers/admin.test.ts +0 -467
- package/tests/client/js/state/router.test.ts +0 -619
- package/tests/client/js/state/schema.test.ts +0 -266
- package/tests/client/js/state/state.test.ts +0 -328
- package/tests/client/js/storage/adapter.test.ts +0 -115
- package/tests/client/js/storage/client.test.ts +0 -250
- package/tests/client/js/storage/db.test.ts +0 -59
- package/tests/client/js/storage/fsa.test.ts +0 -284
- package/tests/client/js/storage/github.test.ts +0 -349
- package/tests/client/js/storage/mock-port.ts +0 -95
- package/tests/client/js/storage/storage.test.ts +0 -77
- package/tests/client/js/storage/workers/frontmatter.test.ts +0 -479
- package/tests/client/js/storage/workers/storage.test.ts +0 -299
- package/tests/client/js/storage/workers/toml-parser.test.ts +0 -169
- package/tests/client/js/storage/workers/yaml-parser.test.ts +0 -168
- package/tests/client/js/utils/file-types.test.ts +0 -268
- package/tests/client/js/utils/frontmatter.test.ts +0 -87
- package/tests/client/js/utils/schema-utils.test.ts +0 -318
- package/tests/client/js/utils/slug.test.ts +0 -58
- package/tests/client/js/utils/sort.test.ts +0 -276
- package/tests/client/js/utils/stable-stringify.test.ts +0 -68
- package/tests/client/js/utils/url-utils.test.ts +0 -70
- package/tests/e2e/backend-connection.test.ts +0 -301
- package/tests/e2e/draft-lifecycle.test.ts +0 -388
- package/tests/e2e/editing.test.ts +0 -355
- package/tests/e2e/github-adapter.test.ts +0 -330
- package/tests/e2e/helpers/mock-adapter.ts +0 -166
- package/tests/e2e/helpers/test-app.ts +0 -155
- package/tests/e2e/navigation.test.ts +0 -358
- package/tests/e2e/publishing.test.ts +0 -345
- package/tests/e2e/unsaved-changes.test.ts +0 -317
- package/tests/setup.ts +0 -2
- package/tests/stubs/codemirror.ts +0 -197
- package/tsconfig.json +0 -19
- package/vitest.config.ts +0 -178
- /package/{src → dist}/client/Admin.svelte +0 -0
- /package/{src → dist}/client/components/BackendPicker.svelte +0 -0
- /package/{src → dist}/client/components/DraftChip.svelte +0 -0
- /package/{src → dist}/client/components/MetadataForm.svelte +0 -0
- /package/{src → dist}/client/components/ThemeToggle.svelte +0 -0
- /package/{src → dist}/client/components/dialogs/DeleteDraftDialog.svelte +0 -0
- /package/{src → dist}/client/components/dialogs/FilenameDialog.svelte +0 -0
- /package/{src → dist}/client/components/editor/EditorPane.svelte +0 -0
- /package/{src → dist}/client/components/editor/EditorTabs.svelte +0 -0
- /package/{src → dist}/client/components/editor/EditorToolbar.svelte +0 -0
- /package/{src → dist}/client/components/editor/FormatSelector.svelte +0 -0
- /package/{src → dist}/client/components/editor/Toolbar.svelte +0 -0
- /package/{src → dist}/client/components/fields/ArrayField.svelte +0 -0
- /package/{src → dist}/client/components/fields/ArrayItem.svelte +0 -0
- /package/{src → dist}/client/components/fields/BooleanField.svelte +0 -0
- /package/{src → dist}/client/components/fields/DateField.svelte +0 -0
- /package/{src → dist}/client/components/fields/EnumField.svelte +0 -0
- /package/{src → dist}/client/components/fields/FieldWrapper.svelte +0 -0
- /package/{src → dist}/client/components/fields/NumberField.svelte +0 -0
- /package/{src → dist}/client/components/fields/ObjectField.svelte +0 -0
- /package/{src → dist}/client/components/fields/SchemaField.svelte +0 -0
- /package/{src → dist}/client/components/fields/StringField.svelte +0 -0
- /package/{src → dist}/client/components/sidebar/AdminSidebar.svelte +0 -0
- /package/{src → dist}/client/components/sidebar/AdminSidebarSort.svelte +0 -0
- /package/{src → dist}/client/css/a11y.css +0 -0
- /package/{src → dist}/client/css/btn.css +0 -0
- /package/{src → dist}/client/css/dialog.css +0 -0
- /package/{src → dist}/client/css/field-input.css +0 -0
- /package/{src → dist}/client/css/reset.css +0 -0
- /package/{src → dist}/client/css/theme.css +0 -0
- /package/{src/client/index.ts → dist/client/index.js} +0 -0
- /package/{src → dist}/virtual.d.ts +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Parsed route state for the admin SPA.
|
|
3
|
+
* The base path is set at build time via virtual:nebula/config so both
|
|
4
|
+
* client-side code and the Vite dev server share the same value.
|
|
5
|
+
*/
|
|
6
|
+
import config from 'virtual:nebula/config';
|
|
7
|
+
// Build-time constant — configured via the Astro integration
|
|
8
|
+
const basePath = config.basePath;
|
|
9
|
+
// Current route, reactive via Svelte 5 runes
|
|
10
|
+
let route = $state(parsePathname(location.pathname));
|
|
11
|
+
export const nav = {
|
|
12
|
+
// Current parsed admin route.
|
|
13
|
+
get route() {
|
|
14
|
+
return route;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Builds an absolute path under the configured basePath by joining segments.
|
|
19
|
+
* Handles the root basePath case ('/') without producing double slashes.
|
|
20
|
+
* @param {...string} segments - Path segments to append (e.g. 'authors', 'my-post')
|
|
21
|
+
* @return {string} The joined path (e.g. '/admin/authors/my-post' or '/authors/my-post')
|
|
22
|
+
*/
|
|
23
|
+
export function adminPath(...segments) {
|
|
24
|
+
if (segments.length === 0)
|
|
25
|
+
return basePath;
|
|
26
|
+
const prefix = basePath === '/' ? '' : basePath;
|
|
27
|
+
return prefix + '/' + segments.join('/');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether a pathname falls under the configured basePath.
|
|
31
|
+
* Matches the basePath exactly or as a prefix followed by '/'.
|
|
32
|
+
* @param {string} pathname - The URL pathname to test
|
|
33
|
+
* @return {boolean} True if the pathname is within the basePath
|
|
34
|
+
*/
|
|
35
|
+
function isUnderBasePath(pathname) {
|
|
36
|
+
// When basePath is '/', every absolute path is under it
|
|
37
|
+
if (basePath === '/')
|
|
38
|
+
return pathname.startsWith('/');
|
|
39
|
+
return pathname === basePath || pathname.startsWith(basePath + '/');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parses a pathname into an AdminRoute by stripping the basePath prefix.
|
|
43
|
+
* @param {string} pathname - The URL pathname to parse
|
|
44
|
+
* @return {AdminRoute} The route corresponding to the given pathname
|
|
45
|
+
*/
|
|
46
|
+
function parsePathname(pathname) {
|
|
47
|
+
/*
|
|
48
|
+
* Strip the basePath prefix at a segment boundary, then split the remainder.
|
|
49
|
+
* Must mirror isUnderBasePath's boundary check to avoid false matches
|
|
50
|
+
* (e.g. basePath '/cms' should not match pathname '/cmsextra/posts').
|
|
51
|
+
*/
|
|
52
|
+
const underBase = isUnderBasePath(pathname);
|
|
53
|
+
const rest = underBase ? pathname.slice(basePath.length) : pathname;
|
|
54
|
+
const segments = rest.split('/').filter(Boolean);
|
|
55
|
+
/*
|
|
56
|
+
* Draft URLs use a 2-segment pattern: {basePath}/{collection}/draft-{draftId}
|
|
57
|
+
* This keeps the same URL depth as regular files so Astro static paths work.
|
|
58
|
+
*/
|
|
59
|
+
if (segments.length >= 2 && segments[1].startsWith('draft-')) {
|
|
60
|
+
return {
|
|
61
|
+
view: 'draft',
|
|
62
|
+
collection: segments[0],
|
|
63
|
+
draftId: segments[1].slice('draft-'.length),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (segments.length >= 2) {
|
|
67
|
+
return { view: 'file', collection: segments[0], slug: segments[1] };
|
|
68
|
+
}
|
|
69
|
+
if (segments.length === 1) {
|
|
70
|
+
return { view: 'collection', collection: segments[0] };
|
|
71
|
+
}
|
|
72
|
+
return { view: 'home' };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Navigates to a path within the admin SPA using the Navigation API.
|
|
76
|
+
* @param {string} path - The path to navigate to (e.g., '/admin/posts')
|
|
77
|
+
* @return {void}
|
|
78
|
+
*/
|
|
79
|
+
export function navigate(path) {
|
|
80
|
+
navigation.navigate(path);
|
|
81
|
+
}
|
|
82
|
+
// Callback to check if the editor has unsaved changes
|
|
83
|
+
let dirtyChecker = null;
|
|
84
|
+
/**
|
|
85
|
+
* Registers a function that returns whether the editor has unsaved changes.
|
|
86
|
+
* @param {() => boolean} checker - Function returning true if there are unsaved changes
|
|
87
|
+
* @return {void}
|
|
88
|
+
*/
|
|
89
|
+
export function registerDirtyChecker(checker) {
|
|
90
|
+
dirtyChecker = checker;
|
|
91
|
+
}
|
|
92
|
+
// Guard against duplicate listener registration (e.g., HMR remount)
|
|
93
|
+
let initialized = false;
|
|
94
|
+
/**
|
|
95
|
+
* Initializes the Navigation API listener, intercepting navigations under the
|
|
96
|
+
* configured basePath and updating reactive route state.
|
|
97
|
+
* Safe to call multiple times — registers the listener only once.
|
|
98
|
+
* @return {void}
|
|
99
|
+
*/
|
|
100
|
+
export function initRouter() {
|
|
101
|
+
if (initialized)
|
|
102
|
+
return;
|
|
103
|
+
initialized = true;
|
|
104
|
+
navigation.addEventListener('navigate', (event) => {
|
|
105
|
+
const url = new URL(event.destination.url);
|
|
106
|
+
// Only intercept navigations within the configured basePath
|
|
107
|
+
if (!isUnderBasePath(url.pathname))
|
|
108
|
+
return;
|
|
109
|
+
// Don't intercept downloads or hash-only changes
|
|
110
|
+
if (event.hashChange || event.downloadRequest)
|
|
111
|
+
return;
|
|
112
|
+
if (!event.canIntercept)
|
|
113
|
+
return;
|
|
114
|
+
/*
|
|
115
|
+
* Block navigation if editor has unsaved changes and user cancels.
|
|
116
|
+
* This check must happen before event.intercept() — if it were inside the
|
|
117
|
+
* handler, the URL would already be updated by the time the user cancels.
|
|
118
|
+
*/
|
|
119
|
+
if (dirtyChecker?.() &&
|
|
120
|
+
!confirm('You have unsaved changes. Leave without saving?')) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
event.intercept({
|
|
125
|
+
handler() {
|
|
126
|
+
route = parsePathname(url.pathname);
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
window.addEventListener('beforeunload', (event) => {
|
|
131
|
+
if (dirtyChecker?.()) {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
type JsonSchema = Record<string, unknown>;
|
|
2
|
+
export declare const schema: {
|
|
3
|
+
readonly active: JsonSchema | null;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Fetches all collection schemas in parallel and caches them.
|
|
7
|
+
* Call once on app startup so schema-derived state is available before the first collection renders.
|
|
8
|
+
* @return {Promise<void>}
|
|
9
|
+
*/
|
|
10
|
+
export declare function prefetchAllSchemas(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetches and caches the JSON Schema for a collection, then sets the reactive schema state.
|
|
13
|
+
* @param {string} collection - The collection name to fetch the schema for
|
|
14
|
+
* @return {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchSchema(collection: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns true if the collection's schema has a date-time property, indicating it supports date-based sorting.
|
|
19
|
+
* Requires prefetchAllSchemas to have been called; returns false if the schema isn't cached yet.
|
|
20
|
+
* @param {string} collection - The collection name to check
|
|
21
|
+
* @return {boolean} True if any property in the schema uses the date-time format
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectionHasDates(collection: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the display title for a collection from its cached schema.
|
|
26
|
+
* Returns null if the schema hasn't been fetched or has no title.
|
|
27
|
+
* @param {string} collection - The collection name
|
|
28
|
+
* @return {string | null} The schema title, or null
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCollectionTitle(collection: string): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the description for a collection from its cached schema.
|
|
33
|
+
* Returns null if the schema hasn't been fetched or has no description.
|
|
34
|
+
* @param {string} collection - The collection name
|
|
35
|
+
* @return {string | null} The schema description, or null
|
|
36
|
+
*/
|
|
37
|
+
export declare function getCollectionDescription(collection: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the resolved file extensions for a collection from its cached schema.
|
|
40
|
+
* Falls back to ['.md', '.mdx'] if the schema hasn't been fetched or declares no files.
|
|
41
|
+
* @param {string} collection - The collection name
|
|
42
|
+
* @return {string[]} Array of file extensions
|
|
43
|
+
*/
|
|
44
|
+
export declare function getSchemaExtensions(collection: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Clears the active schema.
|
|
47
|
+
* @return {void}
|
|
48
|
+
*/
|
|
49
|
+
export declare function clearSchema(): void;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=schema.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.svelte.d.ts","sourceRoot":"","sources":["../../../../src/client/js/state/schema.svelte.ts"],"names":[],"mappings":"AASA,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAQ1C,eAAO,MAAM,MAAM;qBAEH,UAAU,GAAG,IAAI;CAGhC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYxD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAcnE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAM9D;AAgBD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1E;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAKhE;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC"}
|
|
@@ -2,80 +2,68 @@
|
|
|
2
2
|
* Reactive schema state for the admin SPA.
|
|
3
3
|
* Fetches, caches, and exposes JSON Schemas for content collections.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import schemas from 'virtual:nebula/collections';
|
|
7
6
|
import { getExtensionsForSchema } from '../utils/file-types';
|
|
8
|
-
|
|
9
|
-
// JSON Schema object type.
|
|
10
|
-
type JsonSchema = Record<string, unknown>;
|
|
11
|
-
|
|
12
7
|
// Cache of fetched schemas keyed by collection name
|
|
13
|
-
const cache = new Map
|
|
14
|
-
|
|
8
|
+
const cache = new Map();
|
|
15
9
|
// Currently active schema for the selected collection
|
|
16
|
-
let activeSchema = $state
|
|
17
|
-
|
|
10
|
+
let activeSchema = $state(null);
|
|
18
11
|
export const schema = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
// The loaded JSON Schema for the active collection, or null.
|
|
13
|
+
get active() {
|
|
14
|
+
return activeSchema;
|
|
15
|
+
},
|
|
23
16
|
};
|
|
24
|
-
|
|
25
17
|
/**
|
|
26
18
|
* Fetches all collection schemas in parallel and caches them.
|
|
27
19
|
* Call once on app startup so schema-derived state is available before the first collection renders.
|
|
28
20
|
* @return {Promise<void>}
|
|
29
21
|
*/
|
|
30
|
-
export async function prefetchAllSchemas()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
cache.set(name, data);
|
|
41
|
-
}
|
|
22
|
+
export async function prefetchAllSchemas() {
|
|
23
|
+
const entries = Object.entries(schemas);
|
|
24
|
+
const results = await Promise.all(entries.map(async ([name, url]) => {
|
|
25
|
+
const response = await fetch(url);
|
|
26
|
+
const data = (await response.json());
|
|
27
|
+
return [name, data];
|
|
28
|
+
}));
|
|
29
|
+
for (const [name, data] of results) {
|
|
30
|
+
cache.set(name, data);
|
|
31
|
+
}
|
|
42
32
|
}
|
|
43
|
-
|
|
44
33
|
/**
|
|
45
34
|
* Fetches and caches the JSON Schema for a collection, then sets the reactive schema state.
|
|
46
35
|
* @param {string} collection - The collection name to fetch the schema for
|
|
47
36
|
* @return {Promise<void>}
|
|
48
37
|
*/
|
|
49
|
-
export async function fetchSchema(collection
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
activeSchema = data;
|
|
38
|
+
export async function fetchSchema(collection) {
|
|
39
|
+
const cached = cache.get(collection);
|
|
40
|
+
if (cached) {
|
|
41
|
+
activeSchema = cached;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const url = schemas[collection];
|
|
45
|
+
if (!url)
|
|
46
|
+
return;
|
|
47
|
+
const response = await fetch(url);
|
|
48
|
+
const data = (await response.json());
|
|
49
|
+
cache.set(collection, data);
|
|
50
|
+
activeSchema = data;
|
|
63
51
|
}
|
|
64
|
-
|
|
65
52
|
/**
|
|
66
53
|
* Returns true if the collection's schema has a date-time property, indicating it supports date-based sorting.
|
|
67
54
|
* Requires prefetchAllSchemas to have been called; returns false if the schema isn't cached yet.
|
|
68
55
|
* @param {string} collection - The collection name to check
|
|
69
56
|
* @return {boolean} True if any property in the schema uses the date-time format
|
|
70
57
|
*/
|
|
71
|
-
export function collectionHasDates(collection
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
export function collectionHasDates(collection) {
|
|
59
|
+
const s = cache.get(collection);
|
|
60
|
+
if (!s)
|
|
61
|
+
return false;
|
|
62
|
+
const props = s['properties'];
|
|
63
|
+
if (!props)
|
|
64
|
+
return false;
|
|
65
|
+
return Object.values(props).some((p) => p['format'] === 'date-time');
|
|
77
66
|
}
|
|
78
|
-
|
|
79
67
|
/**
|
|
80
68
|
* Reads a top-level string field from a collection's cached schema.
|
|
81
69
|
* Returns null if the schema isn't cached or the field is absent/non-string.
|
|
@@ -83,33 +71,31 @@ export function collectionHasDates(collection: string): boolean {
|
|
|
83
71
|
* @param {string} field - The schema field to read (e.g. 'title', 'description')
|
|
84
72
|
* @return {string | null} The field value, or null
|
|
85
73
|
*/
|
|
86
|
-
function getStringField(collection
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
function getStringField(collection, field) {
|
|
75
|
+
const s = cache.get(collection);
|
|
76
|
+
if (!s)
|
|
77
|
+
return null;
|
|
78
|
+
const value = s[field];
|
|
79
|
+
return typeof value === 'string' ? value : null;
|
|
91
80
|
}
|
|
92
|
-
|
|
93
81
|
/**
|
|
94
82
|
* Returns the display title for a collection from its cached schema.
|
|
95
83
|
* Returns null if the schema hasn't been fetched or has no title.
|
|
96
84
|
* @param {string} collection - The collection name
|
|
97
85
|
* @return {string | null} The schema title, or null
|
|
98
86
|
*/
|
|
99
|
-
export function getCollectionTitle(collection
|
|
100
|
-
|
|
87
|
+
export function getCollectionTitle(collection) {
|
|
88
|
+
return getStringField(collection, 'title');
|
|
101
89
|
}
|
|
102
|
-
|
|
103
90
|
/**
|
|
104
91
|
* Returns the description for a collection from its cached schema.
|
|
105
92
|
* Returns null if the schema hasn't been fetched or has no description.
|
|
106
93
|
* @param {string} collection - The collection name
|
|
107
94
|
* @return {string | null} The schema description, or null
|
|
108
95
|
*/
|
|
109
|
-
export function getCollectionDescription(collection
|
|
110
|
-
|
|
96
|
+
export function getCollectionDescription(collection) {
|
|
97
|
+
return getStringField(collection, 'description');
|
|
111
98
|
}
|
|
112
|
-
|
|
113
99
|
/*
|
|
114
100
|
* Known race condition: if a caller invokes getSchemaExtensions before
|
|
115
101
|
* prefetchAllSchemas() has completed, the schema won't be cached yet and the
|
|
@@ -117,24 +103,23 @@ export function getCollectionDescription(collection: string): string | null {
|
|
|
117
103
|
* mitigates this by awaiting initPromise, which includes prefetchAllSchemas().
|
|
118
104
|
* If the ordering changes, callers should await prefetchAllSchemas() first.
|
|
119
105
|
*/
|
|
120
|
-
|
|
121
106
|
/**
|
|
122
107
|
* Returns the resolved file extensions for a collection from its cached schema.
|
|
123
108
|
* Falls back to ['.md', '.mdx'] if the schema hasn't been fetched or declares no files.
|
|
124
109
|
* @param {string} collection - The collection name
|
|
125
110
|
* @return {string[]} Array of file extensions
|
|
126
111
|
*/
|
|
127
|
-
export function getSchemaExtensions(collection
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
112
|
+
export function getSchemaExtensions(collection) {
|
|
113
|
+
const s = cache.get(collection);
|
|
114
|
+
if (!s)
|
|
115
|
+
return ['.md', '.mdx'];
|
|
116
|
+
const extensions = getExtensionsForSchema(s);
|
|
117
|
+
return extensions.length > 0 ? extensions : ['.md', '.mdx'];
|
|
132
118
|
}
|
|
133
|
-
|
|
134
119
|
/**
|
|
135
120
|
* Clears the active schema.
|
|
136
121
|
* @return {void}
|
|
137
122
|
*/
|
|
138
|
-
export function clearSchema()
|
|
139
|
-
|
|
123
|
+
export function clearSchema() {
|
|
124
|
+
activeSchema = null;
|
|
140
125
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { StorageClient } from '../storage/client';
|
|
2
|
+
import { drafts, refreshDrafts } from '../drafts/merge.svelte';
|
|
3
|
+
export { drafts, refreshDrafts };
|
|
4
|
+
export type ContentItem = {
|
|
5
|
+
filename: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
type PermissionState = 'granted' | 'prompt' | 'denied';
|
|
9
|
+
type BackendType = 'fsa' | 'github' | null;
|
|
10
|
+
export declare const collections: string[];
|
|
11
|
+
export declare const storageClient: StorageClient;
|
|
12
|
+
export declare const backend: {
|
|
13
|
+
readonly type: BackendType;
|
|
14
|
+
readonly ready: boolean;
|
|
15
|
+
readonly permission: PermissionState;
|
|
16
|
+
};
|
|
17
|
+
export declare const content: {
|
|
18
|
+
readonly list: ContentItem[];
|
|
19
|
+
readonly loading: boolean;
|
|
20
|
+
readonly error: string | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Restores a stored backend config from IndexedDB and initializes the SharedWorker.
|
|
24
|
+
* @return {Promise<void>}
|
|
25
|
+
*/
|
|
26
|
+
export declare function restoreBackend(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Re-requests FSA permission. Must be called from a user gesture.
|
|
29
|
+
* @return {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
export declare function requestPermission(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Opens the directory picker and initializes the FSA backend. Must be called from a user gesture.
|
|
34
|
+
* @return {Promise<void>}
|
|
35
|
+
*/
|
|
36
|
+
export declare function pickDirectory(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Connects to a GitHub repository via PAT and persists the config.
|
|
39
|
+
* @param {string} token - GitHub Personal Access Token
|
|
40
|
+
* @param {string} repo - Repository in "owner/repo" format
|
|
41
|
+
* @return {Promise<void>}
|
|
42
|
+
*/
|
|
43
|
+
export declare function connectGitHub(token: string, repo: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Disconnects the backend, clears credentials, and resets all state.
|
|
46
|
+
* @return {Promise<void>}
|
|
47
|
+
*/
|
|
48
|
+
export declare function disconnect(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Loads a collection. Serves from cache instantly if available, then background refreshes.
|
|
51
|
+
* @param {string} collection - The collection name to load
|
|
52
|
+
* @return {void}
|
|
53
|
+
*/
|
|
54
|
+
export declare function loadCollection(collection: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Forces a background reload, keeping the sidebar visible.
|
|
57
|
+
* @param {string} collection - The collection to reload
|
|
58
|
+
* @return {void}
|
|
59
|
+
*/
|
|
60
|
+
export declare function reloadCollection(collection: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Optimistically updates a single item's frontmatter in the content list and cache.
|
|
63
|
+
* @param {string} filename - The filename to update
|
|
64
|
+
* @param {Record<string, unknown>} data - The new frontmatter data
|
|
65
|
+
* @return {void}
|
|
66
|
+
*/
|
|
67
|
+
export declare function updateContentItem(filename: string, data: Record<string, unknown>): void;
|
|
68
|
+
//# sourceMappingURL=state.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.svelte.d.ts","sourceRoot":"","sources":["../../../../src/client/js/state/state.svelte.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACL,MAAM,EAEN,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAGjC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAGF,KAAK,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvD,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;AAE3C,eAAO,MAAM,WAAW,UAA8B,CAAC;AAUvD,eAAO,MAAM,aAAa,eAAuC,CAAC;AAQlE,eAAO,MAAM,OAAO;mBAEN,WAAW;oBAIV,OAAO;yBAIF,eAAe;CAGlC,CAAC;AAEF,eAAO,MAAM,OAAO;mBAEN,WAAW,EAAE;sBAIV,OAAO;oBAIT,MAAM,GAAG,IAAI;CAG3B,CAAC;AAoEF;;;GAGG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA6CpD;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAcvD;AAED;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAcnD;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAehD;AAYD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAMN"}
|