├── .gitignore ├── .template ├── README.md ├── src │ ├── app.css │ ├── cms │ │ └── _README.txt │ ├── lib │ │ ├── cms.ts │ │ ├── sveltecms.config.json │ │ └── sveltecms.config.yml │ └── routes │ │ ├── (cms) │ │ ├── +layout.svelte │ │ ├── +layout.ts │ │ ├── [...path] │ │ │ ├── +layout.ts │ │ │ └── +page.svelte │ │ └── admin │ │ │ ├── +layout@.svelte │ │ │ └── [...adminPath] │ │ │ ├── +page.server.ts │ │ │ ├── +page.svelte │ │ │ ├── +page.ts │ │ │ └── +server.ts │ │ └── +layout.svelte └── tailwind.config.cjs ├── README.md ├── dist ├── CMSAdmin.svelte ├── CMSAdmin.svelte.d.ts ├── CMSEditorForm.svelte ├── CMSEditorForm.svelte.d.ts ├── CMSField.svelte ├── CMSField.svelte.d.ts ├── CMSFieldGroup.svelte ├── CMSFieldGroup.svelte.d.ts ├── cli.d.ts ├── cli.js ├── core │ ├── AdminPage.d.ts │ ├── AdminPage.js │ ├── Component.d.ts │ ├── Component.js │ ├── ContentStore.d.ts │ ├── ContentStore.js │ ├── ContentType.d.ts │ ├── ContentType.js │ ├── Display.d.ts │ ├── Display.js │ ├── EntityTemplate.d.ts │ ├── EntityTemplate.js │ ├── Field.d.ts │ ├── Field.js │ ├── Fieldgroup.d.ts │ ├── Fieldgroup.js │ ├── Hook.d.ts │ ├── Hook.js │ ├── Indexer.d.ts │ ├── Indexer.js │ ├── MediaStore.d.ts │ ├── MediaStore.js │ ├── Plugin.d.ts │ ├── Plugin.js │ ├── ScriptFunction.d.ts │ ├── ScriptFunction.js │ ├── Slug.d.ts │ ├── Slug.js │ ├── Transformer.d.ts │ ├── Transformer.js │ ├── Validator.d.ts │ ├── Validator.js │ ├── Widget.d.ts │ └── Widget.js ├── display │ ├── ContentItem.svelte │ ├── ContentItem.svelte.d.ts │ ├── FieldList.svelte │ ├── FieldList.svelte.d.ts │ ├── FieldValue.svelte │ ├── FieldValue.svelte.d.ts │ ├── Wrapper.svelte │ ├── Wrapper.svelte.d.ts │ └── field │ │ ├── Date.svelte │ │ ├── Date.svelte.d.ts │ │ ├── Fieldgroup.svelte │ │ ├── Fieldgroup.svelte.d.ts │ │ ├── File.svelte │ │ ├── File.svelte.d.ts │ │ ├── Image.svelte │ │ ├── Image.svelte.d.ts │ │ ├── Reference.svelte │ │ └── Reference.svelte.d.ts ├── index.d.ts ├── index.js ├── manifest.d.ts ├── manifest.js ├── plugins │ ├── admin │ │ ├── components │ │ │ ├── CMSComponentList.svelte │ │ │ ├── CMSComponentList.svelte.d.ts │ │ │ ├── CMSComponentListOld.svelte │ │ │ ├── CMSComponentListOld.svelte.d.ts │ │ │ ├── CMSConfigDisplays.svelte │ │ │ ├── CMSConfigDisplays.svelte.d.ts │ │ │ ├── CMSConfigEntity.svelte │ │ │ ├── CMSConfigEntity.svelte.d.ts │ │ │ ├── CMSConfigEntityList.svelte │ │ │ ├── CMSConfigEntityList.svelte.d.ts │ │ │ ├── CMSConfigForm.svelte │ │ │ ├── CMSConfigForm.svelte.d.ts │ │ │ ├── CMSConfigSettings.svelte │ │ │ ├── CMSConfigSettings.svelte.d.ts │ │ │ ├── CMSContentEdit.svelte │ │ │ ├── CMSContentEdit.svelte.d.ts │ │ │ ├── CMSContentList.svelte │ │ │ ├── CMSContentList.svelte.d.ts │ │ │ ├── CMSContentTypeList.svelte │ │ │ ├── CMSContentTypeList.svelte.d.ts │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── index.d.ts │ │ ├── index.js │ │ └── widgets │ │ │ ├── CMSWidgetConfigurableEntity.svelte │ │ │ ├── CMSWidgetConfigurableEntity.svelte.d.ts │ │ │ ├── CMSWidgetDefaultValue.svelte │ │ │ ├── CMSWidgetDefaultValue.svelte.d.ts │ │ │ ├── CMSWidgetDisplayList.svelte │ │ │ ├── CMSWidgetDisplayList.svelte.d.ts │ │ │ ├── CMSWidgetEntity.svelte │ │ │ ├── CMSWidgetEntity.svelte.d.ts │ │ │ ├── CMSWidgetEntityList.svelte │ │ │ ├── CMSWidgetEntityList.svelte.d.ts │ │ │ ├── CMSWidgetEntityTypeField.svelte │ │ │ ├── CMSWidgetEntityTypeField.svelte.d.ts │ │ │ ├── CMSWidgetList.svelte │ │ │ └── CMSWidgetList.svelte.d.ts │ ├── audio │ │ ├── CMSWidgetAudio.svelte │ │ ├── CMSWidgetAudio.svelte.d.ts │ │ ├── CMSWidgetAudioPreview.svelte │ │ ├── CMSWidgetAudioPreview.svelte.d.ts │ │ ├── index.d.ts │ │ └── index.js │ ├── checkboxes │ │ ├── CheckboxText.svelte │ │ ├── CheckboxText.svelte.d.ts │ │ ├── index.d.ts │ │ └── index.js │ ├── defaultContent │ │ ├── index.d.ts │ │ └── index.js │ ├── firebaseFirestore │ │ ├── index.d.ts │ │ └── index.js │ ├── firebaseStorage │ │ ├── index.d.ts │ │ └── index.js │ ├── importContent │ │ ├── ImportContent.svelte │ │ ├── ImportContent.svelte.d.ts │ │ ├── index.d.ts │ │ └── index.js │ ├── markdown │ │ ├── index.d.ts │ │ └── index.js │ ├── math │ │ ├── index.d.ts │ │ └── index.js │ └── staticFiles │ │ ├── index.d.ts │ │ └── index.js ├── sveltecms-forms.css ├── ui │ ├── Button.svelte │ ├── Button.svelte.d.ts │ ├── ButtonConfirm.svelte │ ├── ButtonConfirm.svelte.d.ts │ ├── DisplayResult.svelte │ ├── DisplayResult.svelte.d.ts │ ├── EntityListSectionToggle.svelte │ ├── EntityListSectionToggle.svelte.d.ts │ ├── Modal.svelte │ ├── Modal.svelte.d.ts │ ├── Nav.svelte │ ├── Nav.svelte.d.ts │ ├── PowerTable.svelte │ └── PowerTable.svelte.d.ts ├── utils │ ├── config.d.ts │ ├── config.js │ ├── date.d.ts │ ├── date.js │ ├── endpoints.d.ts │ ├── endpoints.js │ ├── formDataHandler.d.ts │ ├── formDataHandler.js │ ├── getLabelFromID.d.ts │ ├── getLabelFromID.js │ ├── index.d.ts │ ├── index.js │ ├── list.d.ts │ ├── list.js │ ├── path.d.ts │ ├── path.js │ ├── reference.d.ts │ ├── reference.js │ ├── splitTags.d.ts │ └── splitTags.js └── widgets │ ├── CMSWidgetCheckbox.svelte │ ├── CMSWidgetCheckbox.svelte.d.ts │ ├── CMSWidgetDate.svelte │ ├── CMSWidgetDate.svelte.d.ts │ ├── CMSWidgetFieldgroup.svelte │ ├── CMSWidgetFieldgroup.svelte.d.ts │ ├── CMSWidgetFile.svelte │ ├── CMSWidgetFile.svelte.d.ts │ ├── CMSWidgetFilePreview.svelte │ ├── CMSWidgetFilePreview.svelte.d.ts │ ├── CMSWidgetImage.svelte │ ├── CMSWidgetImage.svelte.d.ts │ ├── CMSWidgetImagePreview.svelte │ ├── CMSWidgetImagePreview.svelte.d.ts │ ├── CMSWidgetMultiple.svelte │ ├── CMSWidgetMultiple.svelte.d.ts │ ├── CMSWidgetMultiselect.svelte │ ├── CMSWidgetMultiselect.svelte.d.ts │ ├── CMSWidgetNumber.svelte │ ├── CMSWidgetNumber.svelte.d.ts │ ├── CMSWidgetOptions.svelte │ ├── CMSWidgetOptions.svelte.d.ts │ ├── CMSWidgetRange.svelte │ ├── CMSWidgetRange.svelte.d.ts │ ├── CMSWidgetReference.svelte │ ├── CMSWidgetReference.svelte.d.ts │ ├── CMSWidgetSelect.svelte │ ├── CMSWidgetSelect.svelte.d.ts │ ├── CMSWidgetText.svelte │ ├── CMSWidgetText.svelte.d.ts │ ├── CMSWidgetTextarea.svelte │ ├── CMSWidgetTextarea.svelte.d.ts │ ├── CMSWidgetUndefined.svelte │ ├── CMSWidgetUndefined.svelte.d.ts │ ├── CMSWidgetValue.svelte │ ├── CMSWidgetValue.svelte.d.ts │ ├── MediaChooser.svelte │ ├── MediaChooser.svelte.d.ts │ ├── ScriptableButton.svelte │ └── ScriptableButton.svelte.d.ts ├── jest.config.cjs ├── package-lock.json ├── package.json ├── postcss.config.cjs ├── scripts ├── create-sveltecms │ ├── cli.js │ ├── index.js │ ├── package-lock.json │ ├── package.json │ └── types │ │ └── index.d.ts └── postpackage.js ├── src ├── app.css ├── app.html ├── cms │ ├── WrapperStackblitz.svelte │ ├── blockquote.svelte │ ├── content_blog.svelte │ ├── fieldgroup_frontslides.svelte │ └── fieldgroup_hero.svelte ├── content │ ├── __media.index.json │ ├── __media_usage.index.json │ ├── _blog.index.json │ ├── _docs.index.json │ ├── _landingPage.index.json │ ├── _page.index.json │ ├── _tags.index.json │ ├── _tutorials.index.json │ ├── blog │ │ ├── 2022-04-28-happy-birthday-svelte-cms.md │ │ └── 2022-08-05-references-tagging-and-hooks-oh-my.md │ ├── docs │ │ ├── core-concept.md │ │ ├── getting-started.md │ │ ├── introduction.md │ │ └── object-reference.md │ ├── landingPage │ │ └── front.json │ ├── tags │ │ ├── developers.md │ │ └── site-builders.md │ └── tutorials │ │ └── adding-a-custom-widget-type.md ├── install │ ├── +layout.svelte │ ├── README.md │ ├── _README.txt │ ├── app.css │ ├── cms.ts │ ├── sveltecms.config.json │ ├── sveltecms.config.yml │ └── tailwind.config.cjs ├── lib │ ├── CmsMenu.svelte │ ├── DocsContents.svelte │ ├── cms.ts │ ├── md.ts │ ├── stackblitz.ts │ └── sveltecms.config.yml ├── routes │ ├── (cms) │ │ ├── +layout.svelte │ │ ├── +layout.ts │ │ ├── [...path] │ │ │ ├── +layout.svelte │ │ │ ├── +layout.ts │ │ │ └── +page.svelte │ │ ├── admin │ │ │ ├── +layout@.svelte │ │ │ └── [...adminPath] │ │ │ │ ├── +page.server.ts │ │ │ │ ├── +page.svelte │ │ │ │ ├── +page.ts │ │ │ │ └── +server.ts │ │ └── docs │ │ │ ├── +layout.svelte │ │ │ ├── +page.svelte │ │ │ ├── default-displays │ │ │ └── +page.svelte │ │ │ ├── introduction │ │ │ ├── +page.server.ts │ │ │ └── +page.svelte │ │ │ ├── object-reference │ │ │ ├── +page.svelte │ │ │ ├── _items.ts │ │ │ └── _object-reference-table.svelte │ │ │ └── ui │ │ │ └── +page.svelte │ ├── +layout.svelte │ └── +layout.ts └── sveltecms │ ├── CMSAdmin.svelte │ ├── CMSEditorForm.svelte │ ├── CMSField.svelte │ ├── CMSFieldGroup.svelte │ ├── cli.ts │ ├── core │ ├── AdminPage.ts │ ├── Component.ts │ ├── ContentStore.ts │ ├── ContentType.ts │ ├── Display.ts │ ├── EntityTemplate.ts │ ├── Field.ts │ ├── Fieldgroup.ts │ ├── Hook.ts │ ├── Indexer.ts │ ├── MediaStore.ts │ ├── Plugin.ts │ ├── ScriptFunction.ts │ ├── Slug.ts │ ├── Transformer.ts │ ├── Validator.ts │ └── Widget.ts │ ├── display │ ├── ContentItem.svelte │ ├── FieldList.svelte │ ├── FieldValue.svelte │ ├── Wrapper.svelte │ └── field │ │ ├── Date.svelte │ │ ├── Fieldgroup.svelte │ │ ├── File.svelte │ │ ├── Image.svelte │ │ └── Reference.svelte │ ├── index.ts │ ├── manifest.js │ ├── plugins │ ├── admin │ │ ├── components │ │ │ ├── CMSComponentList.svelte │ │ │ ├── CMSComponentListOld.svelte │ │ │ ├── CMSConfigDisplays.svelte │ │ │ ├── CMSConfigEntity.svelte │ │ │ ├── CMSConfigEntityList.svelte │ │ │ ├── CMSConfigForm.svelte │ │ │ ├── CMSConfigSettings.svelte │ │ │ ├── CMSContentEdit.svelte │ │ │ ├── CMSContentList.svelte │ │ │ ├── CMSContentTypeList.svelte │ │ │ └── index.ts │ │ ├── index.ts │ │ └── widgets │ │ │ ├── CMSWidgetConfigurableEntity.svelte │ │ │ ├── CMSWidgetDefaultValue.svelte │ │ │ ├── CMSWidgetDisplayList.svelte │ │ │ ├── CMSWidgetEntity.svelte │ │ │ ├── CMSWidgetEntityList.svelte │ │ │ ├── CMSWidgetEntityTypeField.svelte │ │ │ └── CMSWidgetList.svelte │ ├── audio │ │ ├── CMSWidgetAudio.svelte │ │ ├── CMSWidgetAudioPreview.svelte │ │ └── index.ts │ ├── checkboxes │ │ ├── CheckboxText.svelte │ │ └── index.ts │ ├── defaultContent │ │ └── index.ts │ ├── firebaseFirestore │ │ └── index.ts │ ├── firebaseStorage │ │ └── index.ts │ ├── importContent │ │ ├── ImportContent.svelte │ │ └── index.ts │ ├── markdown │ │ └── index.ts │ ├── math │ │ └── index.ts │ └── staticFiles │ │ └── index.ts │ ├── sveltecms-forms.css │ ├── ui │ ├── Button.svelte │ ├── ButtonConfirm.svelte │ ├── DisplayResult.svelte │ ├── EntityListSectionToggle.svelte │ ├── Modal.svelte │ ├── Nav.svelte │ └── PowerTable.svelte │ ├── utils │ ├── config.ts │ ├── date.ts │ ├── endpoints.ts │ ├── formDataHandler.ts │ ├── getLabelFromID.ts │ ├── index.ts │ ├── list.ts │ ├── path.ts │ ├── reference.ts │ └── splitTags.ts │ └── widgets │ ├── CMSWidgetCheckbox.svelte │ ├── CMSWidgetDate.svelte │ ├── CMSWidgetFieldgroup.svelte │ ├── CMSWidgetFile.svelte │ ├── CMSWidgetFilePreview.svelte │ ├── CMSWidgetImage.svelte │ ├── CMSWidgetImagePreview.svelte │ ├── CMSWidgetMultiple.svelte │ ├── CMSWidgetMultiselect.svelte │ ├── CMSWidgetNumber.svelte │ ├── CMSWidgetOptions.svelte │ ├── CMSWidgetRange.svelte │ ├── CMSWidgetReference.svelte │ ├── CMSWidgetSelect.svelte │ ├── CMSWidgetText.svelte │ ├── CMSWidgetTextarea.svelte │ ├── CMSWidgetUndefined.svelte │ ├── CMSWidgetValue.svelte │ ├── MediaChooser.svelte │ └── ScriptableButton.svelte ├── static ├── favicon.png └── images │ ├── Birthday_cake.png │ ├── Screen Shot 2022-08-05 at 5.28.23 PM.png │ ├── icons │ ├── cash-banknote.png │ ├── checkbox-checked.svg │ ├── checkbox-indeterminate.svg │ ├── checkbox.svg │ ├── code.png │ ├── device-desktop.png │ ├── file-description.png │ ├── layout-board.png │ ├── photo.png │ ├── plug-connected.png │ └── server-2.png │ └── pexels-andrea-piacquadio-3861923.jpg ├── svelte.config.js ├── tailwind.config.cjs ├── test └── scriptParser.test.ts ├── tsconfig.json └── vite.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | .dccache 6 | .env 7 | .env.* 8 | !.env.example 9 | vite.config.js.timestamp-* 10 | vite.config.ts.timestamp-* 11 | /temp 12 | -------------------------------------------------------------------------------- /.template/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to SvelteKit and SvelteCMS! 2 | 3 | SvelteCMS is a new kind of CMS that runs in your browser or on serverless functions 4 | as part of your SvelteKit site. 5 | 6 | ## Installation 7 | 8 | 1. `npm create sveltecms` 9 | 10 | Since you're reading this file, you've probably already done this part. 11 | 12 | 2. `npm install` 13 | 14 | You have to do this before anything will work. :) 15 | 16 | 3. (optional) `npx svelte-add tailwindcss --tailwindcss-typography` 17 | 18 | Tailwind CSS cooperates really well with SvelteCMS; if you install it, 19 | you'll be able to use Tailwind classes in your Display configurations 20 | and content files, which is one way to make your pages look the way 21 | you want them to look. 22 | 23 | ## Usage 24 | 25 | 1. `npm run dev` 26 | 27 | You should be able to run your site immediately after installing everything. 28 | -------------------------------------------------------------------------------- /.template/src/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --bg-color: white; 3 | --text-color: #222; 4 | background: var(--bg-color); 5 | color: var(--text-color); 6 | } 7 | @media(prefers-color-scheme:dark) { 8 | :root { 9 | --bg-color: #222; 10 | --text-color: white; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /.template/src/cms/_README.txt: -------------------------------------------------------------------------------- 1 | Any Svelte components in this folder can be used in Display configurations in the CMS. 2 | 3 | e.g. if in this folder you have a file named "Blockquote.svelte" then you will be able 4 | to use "Blockquote" as a Display configuration in the CMS. The names are case-sensitive. -------------------------------------------------------------------------------- /.template/src/lib/cms.ts: -------------------------------------------------------------------------------- 1 | import CMS from 'sveltecms' 2 | import conf from './sveltecms.config.json' 3 | import markdownPlugin from 'sveltecms/plugins/markdown' 4 | import defaultContent from 'sveltecms/plugins/defaultContent' 5 | 6 | const cms = new CMS(conf, [ 7 | markdownPlugin(), 8 | defaultContent 9 | ]) 10 | 11 | export default cms 12 | -------------------------------------------------------------------------------- /.template/src/lib/sveltecms.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "configPath": "src/lib/sveltecms.config.json" 3 | } -------------------------------------------------------------------------------- /.template/src/lib/sveltecms.config.yml: -------------------------------------------------------------------------------- 1 | configPath: src/lib/sveltecms.config.yml 2 | -------------------------------------------------------------------------------- /.template/src/routes/(cms)/+layout.svelte: -------------------------------------------------------------------------------- 1 |
2 | 3 | -------------------------------------------------------------------------------- /.template/src/routes/(cms)/[...path]/+layout.ts: -------------------------------------------------------------------------------- 1 | import { error } from '@sveltejs/kit' 2 | import type { LayoutLoad } from './$types' 3 | 4 | export const load:LayoutLoad = async (event) => { 5 | 6 | const { parent } = event 7 | let data = await parent() 8 | 9 | if (!data?.content && !data?.teasers) throw error(404) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /.template/src/routes/(cms)/admin/+layout@.svelte: -------------------------------------------------------------------------------- 1 | 5 | {#if js} 6 | 7 | {/if} 8 | 9 | -------------------------------------------------------------------------------- /.template/src/routes/(cms)/admin/[...adminPath]/+page.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 | {#await data} 21 | fetching data... 22 | {:then data} 23 | 24 | {/await} 25 | -------------------------------------------------------------------------------- /.template/src/routes/(cms)/admin/[...adminPath]/+page.ts: -------------------------------------------------------------------------------- 1 | export const prerender = false 2 | 3 | import cms from '$lib/cms' 4 | import type { RequestEvent } from '@sveltejs/kit' 5 | import admin from 'sveltecms/plugins/admin' 6 | cms.use(admin) 7 | 8 | export async function load(event:RequestEvent) { 9 | 10 | const { params } = event 11 | const args = params.adminPath.split('/') 12 | const adminPage = cms.getAdminPage(params.adminPath) 13 | 14 | let data 15 | if (adminPage?.GET) data = await adminPage.GET({cms, args, event}) 16 | 17 | return { data } 18 | } -------------------------------------------------------------------------------- /.template/src/routes/(cms)/admin/[...adminPath]/+server.ts: -------------------------------------------------------------------------------- 1 | export const prerender = false 2 | 3 | import cms from "$lib/cms" 4 | import { error, type ServerLoad } from "@sveltejs/kit" 5 | import admin from 'sveltecms/plugins/admin' 6 | cms.use(admin) 7 | 8 | export const POST:ServerLoad = async (event) => { 9 | 10 | if (import.meta.env.MODE !== 'development' && !cms?.conf?.settings?.buildAdmin) throw error(404, "Not found") 11 | 12 | const { params } = event 13 | const args = params.adminPath.split('/') 14 | const adminPage = cms.getAdminPage(params.adminPath) 15 | 16 | if (!adminPage) throw error(404) 17 | 18 | if (!adminPage.POST) throw error(405) 19 | 20 | try { 21 | let data = await adminPage.POST({cms, args, event}) 22 | return new Response(JSON.stringify(data)) 23 | } 24 | catch(e) { 25 | throw e 26 | } 27 | 28 | } 29 | 30 | export const DELETE:ServerLoad = async (event) => { 31 | 32 | if (import.meta.env.MODE !== 'development' && !cms?.conf?.settings?.buildAdmin) throw error(404, "Not found") 33 | 34 | const { params } = event 35 | const args = params.adminPath.split('/') 36 | const adminPage = cms.getAdminPage(params.adminPath) 37 | 38 | if (!adminPage) throw error(404) 39 | if (!adminPage.DELETE) throw error(405) 40 | 41 | try { 42 | let data = await adminPage.DELETE({cms, args, event}) 43 | return new Response(JSON.stringify(data)) 44 | } 45 | catch(e) { 46 | throw e 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /.template/src/routes/+layout.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 |
10 | 11 | 17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 | 51 | -------------------------------------------------------------------------------- /.template/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Function to extract classes from the text of matching content files. 3 | * The regex-based search matches class names preceeded by a period. 4 | * Class names are alpha-numerica, but may include dashes, underscores, 5 | * or colons. 6 | */ 7 | const extract = (content) => { 8 | return content.match(/(?<=\.)[-\w:]+/g) || [] 9 | } 10 | 11 | const config = { 12 | // The content array must be expanded into an object. 13 | content: { 14 | // Files in this list should be checked for tailwind classes. 15 | files: [ 16 | "./src/**/*.{html,js,svelte,ts}", 17 | "./src/lib/sveltecms.config.{json,yml}", 18 | "./src/content/**/*.{md,yml,json}", 19 | ], 20 | // The content.extract configuration tells Tailwind to use 21 | // the function defined above for .json, .yml, and .md files. 22 | extract: { 23 | json: extract, 24 | yml: extract, 25 | md: extract, 26 | }, 27 | }, 28 | 29 | theme: { 30 | extend: {}, 31 | }, 32 | 33 | plugins: [], 34 | }; 35 | 36 | module.exports = config; 37 | -------------------------------------------------------------------------------- /dist/CMSAdmin.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | {title} 19 | 20 | 21 |
22 | 23 |
56 | -------------------------------------------------------------------------------- /dist/CMSAdmin.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from "./"; 3 | declare const __propDef: { 4 | props: { 5 | cms: SvelteCMS; 6 | adminPath: string; 7 | url: URL; 8 | data?: Object; 9 | }; 10 | events: { 11 | [evt: string]: CustomEvent; 12 | }; 13 | slots: {}; 14 | }; 15 | export type CmsAdminProps = typeof __propDef.props; 16 | export type CmsAdminEvents = typeof __propDef.events; 17 | export type CmsAdminSlots = typeof __propDef.slots; 18 | export default class CmsAdmin extends SvelteComponentTyped { 19 | } 20 | export {}; 21 | -------------------------------------------------------------------------------- /dist/CMSEditorForm.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from './index'; 3 | declare const __propDef: { 4 | props: { 5 | cms: SvelteCMS; 6 | contentTypeID: string; 7 | result?: any; 8 | values?: { 9 | _type: string; 10 | }; 11 | errors?: {}; 12 | touched?: {}; 13 | disabled?: boolean; 14 | submitOptions?: {}; 15 | isNew?: any; 16 | contentType?: import("./core/ContentType").ContentType; 17 | action?: string; 18 | method?: string; 19 | submit?: (event: any) => Promise; 20 | }; 21 | events: { 22 | [evt: string]: CustomEvent; 23 | }; 24 | slots: { 25 | header: {}; 26 | submit: {}; 27 | }; 28 | }; 29 | export type CmsEditorFormProps = typeof __propDef.props; 30 | export type CmsEditorFormEvents = typeof __propDef.events; 31 | export type CmsEditorFormSlots = typeof __propDef.slots; 32 | export default class CmsEditorForm extends SvelteComponentTyped { 33 | get contentType(): import("./core/ContentType").ContentType; 34 | } 35 | export {}; 36 | -------------------------------------------------------------------------------- /dist/CMSField.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | {#if !field.hidden} 14 |
15 | {#if !field?.widget?.widget} 16 | 17 | {:else if field.multiple && !field.widget.handlesMultiple} 18 | 24 | {:else if field.widget.type === 'fieldgroup'} 25 | 31 | {:else if field.scriptable} 32 | 38 | {:else} 39 | 46 | {/if} 47 | {#if field.helptext} 48 |
{field.helptext}
49 | {/if} 50 |
51 | {/if} 52 | -------------------------------------------------------------------------------- /dist/CMSField.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from './'; 3 | import type { WidgetField } from './'; 4 | declare const __propDef: { 5 | props: { 6 | cms: SvelteCMS; 7 | id: string; 8 | field: WidgetField; 9 | value: any; 10 | class?: string; 11 | }; 12 | events: { 13 | [evt: string]: CustomEvent; 14 | }; 15 | slots: {}; 16 | }; 17 | export type CmsFieldProps = typeof __propDef.props; 18 | export type CmsFieldEvents = typeof __propDef.events; 19 | export type CmsFieldSlots = typeof __propDef.slots; 20 | export default class CmsField extends SvelteComponentTyped { 21 | } 22 | export {}; 23 | -------------------------------------------------------------------------------- /dist/CMSFieldGroup.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from './'; 3 | import type { FieldableEntity } from './'; 4 | declare const __propDef: { 5 | props: { 6 | cms: SvelteCMS; 7 | values?: {}; 8 | errors?: {}; 9 | touched?: {}; 10 | id?: string; 11 | fieldgroup?: FieldableEntity; 12 | widgetFieldGroup?: import("./").WidgetFieldFieldgroup; 13 | }; 14 | events: { 15 | change: CustomEvent; 16 | } & { 17 | [evt: string]: CustomEvent; 18 | }; 19 | slots: {}; 20 | }; 21 | export type CmsFieldGroupProps = typeof __propDef.props; 22 | export type CmsFieldGroupEvents = typeof __propDef.events; 23 | export type CmsFieldGroupSlots = typeof __propDef.slots; 24 | export default class CmsFieldGroup extends SvelteComponentTyped { 25 | } 26 | export {}; 27 | -------------------------------------------------------------------------------- /dist/cli.d.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | export {}; 3 | -------------------------------------------------------------------------------- /dist/core/AdminPage.d.ts: -------------------------------------------------------------------------------- 1 | import { type RequestEvent } from "@sveltejs/kit"; 2 | import type SvelteCMS from ".."; 3 | import { Component, type ComponentConfigSetting } from "./Component"; 4 | import type { Content } from "./ContentStore"; 5 | import type { EntityTemplate } from "./EntityTemplate"; 6 | export declare const templateAdminPage: EntityTemplate; 7 | export type AdminPageConfig = { 8 | id: string; 9 | component: string | ComponentConfigSetting; 10 | label?: string | (string | undefined | false)[]; 11 | GET?: (data: { 12 | cms: SvelteCMS; 13 | args: string[]; 14 | event?: RequestEvent; 15 | }) => Promise; 16 | POST?: (data: { 17 | cms: SvelteCMS; 18 | args: string[]; 19 | event?: RequestEvent; 20 | values?: Content; 21 | }) => Promise; 22 | DELETE?: (data: { 23 | cms: SvelteCMS; 24 | args: string[]; 25 | event?: RequestEvent; 26 | values?: Content; 27 | }) => Promise; 28 | }; 29 | export declare class AdminPage { 30 | id: string; 31 | component: Component; 32 | label: (string | undefined | false)[]; 33 | GET?: (data: { 34 | cms: SvelteCMS; 35 | args: string[]; 36 | event?: RequestEvent; 37 | }) => Promise; 38 | POST?: (data: { 39 | cms: SvelteCMS; 40 | args: string[]; 41 | event?: RequestEvent; 42 | values?: Content; 43 | }) => Promise; 44 | DELETE?: (data: { 45 | cms: SvelteCMS; 46 | args: string[]; 47 | event?: RequestEvent; 48 | values?: Content; 49 | }) => Promise; 50 | constructor(conf: AdminPageConfig, cms: SvelteCMS); 51 | } 52 | export declare const adminPages: AdminPageConfig[]; 53 | -------------------------------------------------------------------------------- /dist/core/Component.d.ts: -------------------------------------------------------------------------------- 1 | import type SvelteCMS from ".."; 2 | import type { ConfigurableEntityConfigSetting, ConfigurableEntityType, TypedEntityConfigSetting, ConfigurableEntity, ConfigSetting, TypedEntity, EntityType } from ".."; 3 | import type { EntityTemplate } from "./EntityTemplate"; 4 | /** 5 | * Note: Components must be pre-registered for ANY type of import in SvelteKit. 6 | * Dynamic import() cannot be used with a variable in the import string; this 7 | * is a limitation of the bundler. See https://github.com/sveltejs/svelte/issues/6702. 8 | */ 9 | export declare const templateComponent: EntityTemplate; 10 | export type ComponentType = EntityType & ConfigurableEntityType & { 11 | admin?: true; 12 | component: Object; 13 | }; 14 | export type ComponentConfigSetting = TypedEntityConfigSetting & ConfigurableEntityConfigSetting; 15 | export declare class Component implements ConfigurableEntity, TypedEntity { 16 | id: string; 17 | type: string; 18 | component: Object | Promise; 19 | admin?: true; 20 | plugin?: string; 21 | options?: ConfigSetting; 22 | constructor(conf: string | ComponentConfigSetting, cms: SvelteCMS); 23 | } 24 | export default Component; 25 | -------------------------------------------------------------------------------- /dist/core/Component.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Note: Components must be pre-registered for ANY type of import in SvelteKit. 3 | * Dynamic import() cannot be used with a variable in the import string; this 4 | * is a limitation of the bundler. See https://github.com/sveltejs/svelte/issues/6702. 5 | */ 6 | export const templateComponent = { 7 | id: 'component', 8 | label: 'Component', 9 | labelPlural: 'Components', 10 | description: `Components are .svelte files used to display content. Some are provided by plugins, but they can also be created by developers for a particular app or website.`, 11 | typeField: true, 12 | typeInherits: true, 13 | typeRestricted: true, 14 | isConfigurable: true, 15 | }; 16 | export class Component { 17 | constructor(conf, cms) { 18 | let componentType = typeof conf === 'string' ? cms.components[conf] : (cms.components[conf?.type] || cms.components[conf?.id]); 19 | if (!componentType) 20 | throw new Error(`Component type not found for ${conf?.['id'] || conf?.['type'] || conf}`); 21 | this.id = componentType.id; 22 | this.type = componentType.id; 23 | this.component = componentType.component; 24 | this.admin = componentType?.admin; 25 | this.options = cms.getInstanceOptions(componentType, conf); 26 | } 27 | } 28 | export default Component; 29 | -------------------------------------------------------------------------------- /dist/core/ContentStore.js: -------------------------------------------------------------------------------- 1 | export const templateContentStore = { 2 | id: 'contentStore', 3 | label: 'Content Store', 4 | labelPlural: 'Content Stores', 5 | description: `A Content Store connects with some type of database or file system to provide storage for content managed by SvelteCMS.`, 6 | typeField: true, 7 | typeInherits: true, 8 | typeRequired: true, 9 | typeRestricted: true, 10 | isConfigurable: true, 11 | }; 12 | export class ContentStore { 13 | constructor(conf, cms) { 14 | if (!conf) 15 | conf = { type: 'staticFiles' }; 16 | else if (typeof conf === 'string') 17 | conf = { type: conf }; 18 | let store = cms.contentStores[conf?.type] || cms.contentStores[conf?.id]; 19 | if (!store) 20 | store = Object.values(cms.contentStores)[0]; 21 | this.id = store.id; 22 | this.type = conf.type; 23 | this.listContent = store?.listContent || (async () => { console.error(`Store not found: (${this?.['id']})`); return []; }); 24 | this.getContent = store?.getContent || (async () => { console.error(`Store not found: (${this?.['id']})`); return {}; }); 25 | this.saveContent = store?.saveContent || (async () => { console.error(`Store not found: (${this?.['id']})`); return {}; }); 26 | this.deleteContent = store?.deleteContent || (async () => { console.error(`Store not found: (${this?.['id']})`); return {}; }); 27 | this.options = cms.getInstanceOptions(store, conf); 28 | } 29 | } 30 | export default ContentStore; 31 | -------------------------------------------------------------------------------- /dist/core/ContentType.d.ts: -------------------------------------------------------------------------------- 1 | import type SvelteCMS from '..'; 2 | import type { ConfigSetting, DisplayableEntity, DisplayableEntityConfigSetting, FieldableEntity, LabeledEntity } from '..'; 3 | import { SlugConfig, type SlugConfigSetting } from './Slug'; 4 | import { ContentStore, type ContentStoreConfigSetting } from './ContentStore'; 5 | import type { MediaStoreConfigSetting } from './MediaStore'; 6 | import Field, { type FieldConfigSetting } from './Field'; 7 | import type { EntityTemplate } from './EntityTemplate'; 8 | import type { EntityDisplayConfigSetting } from './Display'; 9 | export declare const templateContentType: EntityTemplate; 10 | export type ContentTypeConfigSetting = ConfigSetting & DisplayableEntityConfigSetting & { 11 | label?: string; 12 | fields: { 13 | [id: string]: string | FieldConfigSetting; 14 | }; 15 | contentStore: string | ContentStoreConfigSetting; 16 | mediaStore?: string | MediaStoreConfigSetting; 17 | slug?: string | string[] | SlugConfigSetting; 18 | form?: { 19 | method?: 'post' | 'get'; 20 | action?: string; 21 | }; 22 | }; 23 | export declare class ContentType implements FieldableEntity, LabeledEntity, DisplayableEntity { 24 | id: string; 25 | label: string; 26 | isFieldable: boolean; 27 | slug: SlugConfig; 28 | contentStore: ContentStore; 29 | mediaStore?: string | MediaStoreConfigSetting; 30 | displays: EntityDisplayConfigSetting; 31 | indexFields: string[]; 32 | fields: { 33 | [key: string]: Field; 34 | }; 35 | form: { 36 | method?: 'post' | 'get'; 37 | action?: string; 38 | }; 39 | constructor(id: any, conf: ContentTypeConfigSetting, cms: SvelteCMS); 40 | } 41 | export default ContentType; 42 | -------------------------------------------------------------------------------- /dist/core/Display.d.ts: -------------------------------------------------------------------------------- 1 | import type { Component, ComponentType } from "./Component"; 2 | import type SvelteCMS from ".."; 3 | import type { EntityTemplate } from "./EntityTemplate"; 4 | export type DisplayConfig = { 5 | type: string; 6 | wrapper?: string; 7 | label?: string; 8 | html?: boolean; 9 | link?: boolean; 10 | multiple?: boolean; 11 | }; 12 | export declare function isDisplayConfig(item: DisplayConfig | any): item is DisplayConfig; 13 | export type DisplayConfigSetting = string | DisplayConfig; 14 | export type EntityDisplayConfigSetting = DisplayConfigSetting | { 15 | [id: string]: DisplayConfigSetting; 16 | }; 17 | export type EntityDisplayConfig = { 18 | [id: string]: DisplayConfigSetting; 19 | }; 20 | export type FullEntityDisplayConfig = EntityDisplayConfig & { 21 | default: DisplayConfigSetting; 22 | page: DisplayConfigSetting; 23 | teaser: DisplayConfigSetting; 24 | reference: DisplayConfigSetting; 25 | }; 26 | export declare const defaultDisplayModes: string[]; 27 | export declare const displayNoneKeywords: string[]; 28 | export declare function isDisplayNone(conf: any): boolean; 29 | export declare const templateDisplay: EntityTemplate; 30 | export declare class Display { 31 | type: string; 32 | isDisplayed: boolean; 33 | link: boolean; 34 | multiple: boolean; 35 | component?: Component; 36 | wrapper?: Display; 37 | label?: Display; 38 | html?: boolean; 39 | tag?: string; 40 | id?: string; 41 | classes?: string[]; 42 | constructor(conf: DisplayConfigSetting, cms: SvelteCMS); 43 | get classList(): string; 44 | } 45 | export declare const displayComponents: ComponentType[]; 46 | export default Display; 47 | -------------------------------------------------------------------------------- /dist/core/EntityTemplate.d.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigFieldConfigSetting } from "./Field"; 2 | export type EntityTemplate = { 3 | id: string; 4 | label: string; 5 | labelPlural: string; 6 | description: string; 7 | typeField: string | boolean; 8 | typeInherits?: boolean; 9 | typeRequired?: boolean; 10 | typeRestricted?: boolean; 11 | isConfigurable?: boolean; 12 | isDisplayable?: boolean; 13 | listFields?: string[]; 14 | isFieldable?: boolean; 15 | configFields?: { 16 | [id: string]: ConfigFieldConfigSetting; 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /dist/core/EntityTemplate.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /dist/core/Fieldgroup.d.ts: -------------------------------------------------------------------------------- 1 | import type { FieldableEntityConfigSetting, EntityType, FieldableEntity, DisplayableEntity, DisplayableEntityConfigSetting } from ".."; 2 | import type SvelteCMS from ".."; 3 | import type { EntityDisplayConfigSetting } from "./Display"; 4 | import type { EntityTemplate } from "./EntityTemplate"; 5 | import Field, { type ConfigFieldConfigSetting } from "./Field"; 6 | export type FieldgroupConfigSetting = FieldableEntityConfigSetting & EntityType & DisplayableEntityConfigSetting & { 7 | admin?: boolean; 8 | tags?: string | string[]; 9 | }; 10 | export type AdminFieldgroupConfigSetting = FieldgroupConfigSetting & { 11 | admin: true; 12 | fields: { 13 | [id: string]: ConfigFieldConfigSetting; 14 | }; 15 | }; 16 | export declare const templateFieldgroup: EntityTemplate; 17 | export declare class Fieldgroup implements EntityType, FieldableEntity, DisplayableEntity { 18 | id: string; 19 | tags: string[]; 20 | admin?: boolean; 21 | plugin?: string; 22 | displays: EntityDisplayConfigSetting; 23 | isFieldable: boolean; 24 | fields: { 25 | [id: string]: Field; 26 | }; 27 | constructor(conf: string | FieldgroupConfigSetting, cms: SvelteCMS); 28 | } 29 | export type AdminFieldgroup = Fieldgroup & { 30 | admin: true; 31 | }; 32 | export default Fieldgroup; 33 | -------------------------------------------------------------------------------- /dist/core/Fieldgroup.js: -------------------------------------------------------------------------------- 1 | import Field, {} from "./Field"; 2 | export const templateFieldgroup = { 3 | id: 'fieldgroup', 4 | label: 'Fieldgroup', 5 | labelPlural: 'Fieldgroups', 6 | description: `A Fieldgroup is a group of Fields which may be displayed by a Component.`, 7 | typeField: false, 8 | isConfigurable: true, 9 | isDisplayable: true, 10 | isFieldable: true, 11 | listFields: ['tags'], 12 | configFields: { 13 | tags: { 14 | type: 'text', 15 | multiple: true, 16 | default: [], 17 | helptext: 'Fields with "Use Components" checked can specify which Fieldgroups may be chosen by ID or by Tags.', 18 | widget: { 19 | type: 'options', 20 | items: ['fullwidth', 'block', 'inline'], 21 | oneline: true, 22 | } 23 | } 24 | } 25 | }; 26 | export class Fieldgroup { 27 | constructor(conf, cms) { 28 | this.tags = []; 29 | this.isFieldable = true; 30 | conf = typeof conf === 'string' ? cms.fieldgroups[conf] : conf; 31 | this.id = conf.id; 32 | this.admin = conf.admin; 33 | if (conf.tags) 34 | this.tags = typeof conf.tags === 'string' ? conf.tags.split(/[\s,]+/) : conf.tags; 35 | this.displays = cms.getFullEntityDisplayConfig('fieldgroup', conf); 36 | this.fields = Object.fromEntries(Object.entries(conf.fields).map(([id, conf]) => { 37 | return [id, new Field(id, conf, cms)]; 38 | })); 39 | } 40 | } 41 | export default Fieldgroup; 42 | -------------------------------------------------------------------------------- /dist/core/Plugin.d.ts: -------------------------------------------------------------------------------- 1 | import type { CMSConfigSetting, CMSListConfig } from '..'; 2 | import type { ComponentType } from './Component'; 3 | import type { EntityTemplate } from './EntityTemplate'; 4 | import type { AdminPageConfig } from './AdminPage'; 5 | import type { ContentStoreType } from './ContentStore'; 6 | import type { ConfigFieldConfigSetting, FieldType } from './Field'; 7 | import type { FieldgroupConfigSetting } from './Fieldgroup'; 8 | import type { PluginHooks } from './Hook'; 9 | import type { IndexerType } from './Indexer'; 10 | import type { MediaStoreType } from './MediaStore'; 11 | import type { ScriptFunctionType } from './ScriptFunction'; 12 | import type Transformer from './Transformer'; 13 | import type { WidgetType } from './Widget'; 14 | export declare const templatePlugin: EntityTemplate; 15 | export type CMSPlugin = { 16 | id: string; 17 | adminPages?: AdminPageConfig[]; 18 | fieldTypes?: FieldType[]; 19 | widgetTypes?: WidgetType[]; 20 | transformers?: Transformer[]; 21 | indexers?: IndexerType[]; 22 | contentStores?: ContentStoreType[]; 23 | mediaStores?: MediaStoreType[]; 24 | adminFieldgroups?: FieldgroupConfigSetting[]; 25 | components?: ComponentType[]; 26 | lists?: CMSListConfig; 27 | optionFields?: { 28 | [key: string]: ConfigFieldConfigSetting; 29 | }; 30 | fieldWidgets?: { 31 | [key: string]: string[]; 32 | }; 33 | hooks?: PluginHooks; 34 | scriptFunctions?: ScriptFunctionType[]; 35 | conf?: Omit; 36 | }; 37 | export type CMSPluginBuilder = (config?: any) => CMSPlugin; 38 | -------------------------------------------------------------------------------- /dist/core/Plugin.js: -------------------------------------------------------------------------------- 1 | export const templatePlugin = { 2 | id: 'plugin', 3 | label: 'Plugin', 4 | labelPlural: 'Plugins', 5 | description: 'Plugins add functionality and/or configuration to the SvelteCMS instance.', 6 | typeField: false, 7 | isConfigurable: true, 8 | }; 9 | -------------------------------------------------------------------------------- /dist/core/Slug.d.ts: -------------------------------------------------------------------------------- 1 | import type SvelteCMS from '..'; 2 | import type { ConfigSetting, ConfigurableEntityConfigSettingValue } from '..'; 3 | import type { TransformerConfigSetting } from './Transformer'; 4 | import type { EntityTemplate } from './EntityTemplate'; 5 | export interface SlugConfigSetting extends ConfigSetting { 6 | fields: string | string[]; 7 | separator?: string; 8 | slugify?: ConfigurableEntityConfigSettingValue; 9 | } 10 | export declare const templateSlug: EntityTemplate; 11 | export declare class SlugConfig { 12 | fields: string[]; 13 | separator: string; 14 | slugify: ConfigurableEntityConfigSettingValue; 15 | constructor(conf: string | string[] | SlugConfigSetting, cms: SvelteCMS); 16 | } 17 | export default SlugConfig; 18 | -------------------------------------------------------------------------------- /dist/core/Transformer.d.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigurableEntityType, ConfigSetting, ConfigurableEntityConfigSetting } from ".."; 2 | import type { EntityTemplate } from "./EntityTemplate"; 3 | export type TransformerConfigSetting = ConfigurableEntityConfigSetting; 4 | export declare const templateTransformer: EntityTemplate; 5 | export type Transformer = ConfigurableEntityType & { 6 | description: string; 7 | fn: (value: any, opts?: ConfigSetting) => any; 8 | }; 9 | export declare const transformers: { 10 | [id: string]: Transformer; 11 | }; 12 | export default Transformer; 13 | -------------------------------------------------------------------------------- /dist/core/Validator.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Validator { 2 | } 3 | export default Validator; 4 | -------------------------------------------------------------------------------- /dist/core/Validator.js: -------------------------------------------------------------------------------- 1 | // TODO 2 | export class Validator { 3 | } 4 | export default Validator; 5 | -------------------------------------------------------------------------------- /dist/core/Widget.d.ts: -------------------------------------------------------------------------------- 1 | import type SvelteCMS from ".."; 2 | import type { ConfigSetting, TypedEntityConfigSetting, ConfigurableEntityConfigSetting, ConfigurableEntityType, ConfigurableEntity } from ".."; 3 | import type ContentType from "./ContentType"; 4 | import type Field from "./Field"; 5 | import type { EntityTemplate } from "./EntityTemplate"; 6 | export type FormDataHandler = (value: { 7 | [key: string]: any; 8 | }, cms: SvelteCMS, contentType: ContentType, field: Field) => Promise; 9 | export type WidgetConfigSetting = TypedEntityConfigSetting & ConfigurableEntityConfigSetting & {}; 10 | export declare const templateWidget: EntityTemplate; 11 | export type WidgetType = ConfigurableEntityType & { 12 | description: string; 13 | widget: Object; 14 | fieldTypes: string[]; 15 | handlesMultiple?: boolean; 16 | handlesMedia?: boolean; 17 | handlesFields?: boolean; 18 | admin?: boolean; 19 | formDataHandler?: FormDataHandler; 20 | }; 21 | export declare class Widget implements ConfigurableEntity { 22 | type: string; 23 | widget: Object; 24 | handlesMultiple: boolean; 25 | handlesMedia: boolean; 26 | handlesFields: boolean; 27 | options: ConfigSetting; 28 | formDataHandler?: FormDataHandler; 29 | constructor(conf: string | WidgetConfigSetting, cms: SvelteCMS); 30 | } 31 | export declare const widgetTypes: { 32 | [key: string]: WidgetType; 33 | }; 34 | export default Widget; 35 | -------------------------------------------------------------------------------- /dist/display/ContentItem.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | {#if display?.component} 15 | 16 | {#await display.component.component then component} 17 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | {/await} 31 | 32 | {:else if display?.isDisplayed} 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | {/if} 45 | -------------------------------------------------------------------------------- /dist/display/ContentItem.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type { DisplayableEntity, EntityType, FieldableEntity } from ".."; 3 | import type SvelteCMS from ".."; 4 | import type { Content } from "../core/ContentStore"; 5 | declare const __propDef: { 6 | props: { 7 | cms: SvelteCMS; 8 | entity?: EntityType & FieldableEntity & DisplayableEntity; 9 | item: Content; 10 | displayMode: string; 11 | class?: string; 12 | }; 13 | events: { 14 | [evt: string]: CustomEvent; 15 | }; 16 | slots: {}; 17 | }; 18 | export type ContentItemProps = typeof __propDef.props; 19 | export type ContentItemEvents = typeof __propDef.events; 20 | export type ContentItemSlots = typeof __propDef.slots; 21 | export default class ContentItem extends SvelteComponentTyped { 22 | } 23 | export {}; 24 | -------------------------------------------------------------------------------- /dist/display/FieldList.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | {#each fieldlist as [id, field]} 15 | {#if typeof item?.[id] !== 'undefined' && (!Array.isArray(item[id]) || item[id]?.['length'])} 16 | 17 | {#if displays[id]?.wrapper?.isDisplayed} 18 | 19 | 28 | 35 | 36 | 37 | {:else if displays[id]?.isDisplayed} 38 | 39 | 46 | 47 | {/if} 48 | 49 | {/if} 50 | {/each} 51 | -------------------------------------------------------------------------------- /dist/display/FieldList.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from ".."; 3 | import type { FieldableEntity } from ".."; 4 | import type { Value } from "../core/ContentStore"; 5 | declare const __propDef: { 6 | props: { 7 | cms: SvelteCMS; 8 | entity: FieldableEntity; 9 | item: { 10 | [key: string]: Value; 11 | }; 12 | displayMode: string; 13 | }; 14 | events: { 15 | [evt: string]: CustomEvent; 16 | }; 17 | slots: {}; 18 | }; 19 | export type FieldListProps = typeof __propDef.props; 20 | export type FieldListEvents = typeof __propDef.events; 21 | export type FieldListSlots = typeof __propDef.slots; 22 | export default class FieldList extends SvelteComponentTyped { 23 | } 24 | export {}; 25 | -------------------------------------------------------------------------------- /dist/display/FieldValue.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from ".."; 3 | import type { Content, Value } from "../core/ContentStore"; 4 | import type { Field } from "../core/Field"; 5 | declare const __propDef: { 6 | props: { 7 | cms: SvelteCMS; 8 | entity: Field; 9 | item: Value; 10 | parent: Content; 11 | displayMode?: string; 12 | }; 13 | events: { 14 | [evt: string]: CustomEvent; 15 | }; 16 | slots: {}; 17 | }; 18 | export type FieldValueProps = typeof __propDef.props; 19 | export type FieldValueEvents = typeof __propDef.events; 20 | export type FieldValueSlots = typeof __propDef.slots; 21 | export default class FieldValue extends SvelteComponentTyped { 22 | } 23 | export {}; 24 | -------------------------------------------------------------------------------- /dist/display/Wrapper.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | {#if display?.wrapper?.isDisplayed} 12 | 13 | {#if display.component} 14 | {#await display.component.component then component} 15 | 16 | {/await} 17 | {:else} 18 | 19 | {/if} 20 | 21 | {:else} 22 | {#if display.component} 23 | {#await display.component.component then component} 24 | 25 | {/await} 26 | {:else} 27 | 28 | {/if} 29 | {/if} -------------------------------------------------------------------------------- /dist/display/Wrapper.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from ".."; 3 | import type { Content, Value } from "../core/ContentStore"; 4 | import type ContentType from "../core/ContentType"; 5 | import type { Display } from "../core/Display"; 6 | import type Field from "../core/Field"; 7 | import type Fieldgroup from "./field/Fieldgroup.svelte"; 8 | declare const __propDef: { 9 | props: { 10 | cms: SvelteCMS; 11 | entity: ContentType | Field | Fieldgroup; 12 | item?: Content | Value | undefined; 13 | parent?: Content | Value | undefined; 14 | displayMode: string; 15 | display: Display; 16 | class?: string; 17 | }; 18 | events: { 19 | [evt: string]: CustomEvent; 20 | }; 21 | slots: { 22 | default: {}; 23 | }; 24 | }; 25 | export type WrapperProps = typeof __propDef.props; 26 | export type WrapperEvents = typeof __propDef.events; 27 | export type WrapperSlots = typeof __propDef.slots; 28 | export default class Wrapper extends SvelteComponentTyped { 29 | } 30 | export {}; 31 | -------------------------------------------------------------------------------- /dist/display/field/Date.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | {displayDate} 21 | 22 | -------------------------------------------------------------------------------- /dist/display/field/Date.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from "../.."; 3 | import type Field from "../../core/Field"; 4 | declare const __propDef: { 5 | props: { 6 | cms: SvelteCMS; 7 | entity: Field; 8 | item: string | Date; 9 | displayMode: string; 10 | }; 11 | events: { 12 | [evt: string]: CustomEvent; 13 | }; 14 | slots: {}; 15 | }; 16 | export type DateProps = typeof __propDef.props; 17 | export type DateEvents = typeof __propDef.events; 18 | export type DateSlots = typeof __propDef.slots; 19 | export default class Date extends SvelteComponentTyped { 20 | } 21 | export {}; 22 | -------------------------------------------------------------------------------- /dist/display/field/Fieldgroup.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | {#if fieldgroup} 14 | 15 | {/if} 16 | -------------------------------------------------------------------------------- /dist/display/field/Fieldgroup.svelte.d.ts: -------------------------------------------------------------------------------- 1 | import { SvelteComponentTyped } from "svelte"; 2 | import type SvelteCMS from "../.."; 3 | import type { Content } from "../../core/ContentStore"; 4 | import type Field from "../../core/Field"; 5 | declare const __propDef: { 6 | props: { 7 | cms: SvelteCMS; 8 | entity: Field; 9 | item: Content & { 10 | _fieldgroup?: string; 11 | }; 12 | displayMode: string; 13 | }; 14 | events: { 15 | [evt: string]: CustomEvent; 16 | }; 17 | slots: {}; 18 | }; 19 | export type FieldgroupProps = typeof __propDef.props; 20 | export type FieldgroupEvents = typeof __propDef.events; 21 | export type FieldgroupSlots = typeof __propDef.slots; 22 | export default class Fieldgroup extends SvelteComponentTyped { 23 | } 24 | export {}; 25 | -------------------------------------------------------------------------------- /dist/display/field/File.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | {#if filepath} 13 | 14 | {filename} 15 | {#if item?.['_meta']?.type?.startsWith('audio/')} 16 |