@slicemachine/adapter-sveltekit 0.3.85-alpha.jp-allow-slice-index-generation.7 ā 0.3.85-beta.1
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.
@@ -11,30 +11,8 @@ Placeholder component for {slice.slice_type} (variation: {slice.variation}) slic
|
|
11
11
|
<br />
|
12
12
|
<strong>You can edit this slice directly in your code editor.</strong>
|
13
13
|
<!--
|
14
|
-
š” Use Prismic MCP with your code editor
|
15
|
-
|
16
|
-
Get AI-powered help to build your slice components ā based on your actual model.
|
17
|
-
|
18
|
-
ā¶ļø Setup:
|
19
|
-
1. Add a new MCP Server in your code editor:
|
20
|
-
|
21
|
-
{
|
22
|
-
"mcpServers": {
|
23
|
-
"Prismic MCP": {
|
24
|
-
"command": "npx",
|
25
|
-
"args": ["-y", "@prismicio/mcp-server@latest"]
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
2. Select a model optimized for coding (e.g. Claude 3.7 Sonnet or similar)
|
31
|
-
|
32
|
-
ā
Then open your slice file and ask your code editor:
|
33
|
-
"Code this slice"
|
34
|
-
|
35
|
-
Your code editor reads your slice model and helps you code faster ā”
|
36
|
-
šļø Give your feedback: https://community.prismic.io/t/help-us-shape-the-future-of-slice-creation/19505
|
37
|
-
š Documentation: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
14
|
+
š” Use the Prismic MCP server with your code editor
|
15
|
+
š Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
38
16
|
-->
|
39
17
|
`;
|
40
18
|
function sliceTemplate(args) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slice-create.templates.cjs","sources":["../../../src/hooks/slice-create.templates.ts"],"sourcesContent":["import { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { source as svelte } from \"common-tags\";\n\nimport { pascalCase } from \"../lib/pascalCase\";\n\nconst PLACEHOLDER = `\nPlaceholder component for {slice.slice_type} (variation: {slice.variation}) slices.\n<br />\n<strong>You can edit this slice directly in your code editor.</strong>\n<!--\nš” Use
|
1
|
+
{"version":3,"file":"slice-create.templates.cjs","sources":["../../../src/hooks/slice-create.templates.ts"],"sourcesContent":["import { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { source as svelte } from \"common-tags\";\n\nimport { pascalCase } from \"../lib/pascalCase\";\n\nconst PLACEHOLDER = `\nPlaceholder component for {slice.slice_type} (variation: {slice.variation}) slices.\n<br />\n<strong>You can edit this slice directly in your code editor.</strong>\n<!--\nš” Use the Prismic MCP server with your code editor\nš Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server\n-->\n`;\n\nexport function sliceTemplate(args: {\n\tmodel: SharedSlice;\n\ttypescript: boolean;\n\tversion: number;\n}): string {\n\tconst { model, typescript, version } = args;\n\n\tconst pascalName = pascalCase(model.name);\n\n\tconst v5TS = svelte`\n\t\t<script lang=\"ts\">\n\t\t\timport type { Content } from '@prismicio/client';\n\t\t\timport type { SliceComponentProps } from '@prismicio/svelte';\n\n\t\t\ttype Props = SliceComponentProps<Content.${pascalName}Slice>;\n\n\t\t\tconst { slice }: Props = $props();\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v5JS = svelte`\n\t\t<script>\n\t\t\t/* @typedef {import(\"@prismicio/client\").Content} Content */\n\t\t\t/* @typedef {import(\"@prismicio/svelte\").SliceComponentProps} SliceComponentProps */\n\n\t\t\t/* @type {SliceComponentProps<Content.${pascalName}Slice>} */\n\t\t\tconst { slice } = $props();\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v4TS = svelte`\n\t\t<script lang=\"ts\">\n\t\t\timport type { Content } from '@prismicio/client';\n\n\t\t\texport let slice: Content.${pascalName}Slice;\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v4JS = svelte`\n\t\t<script>\n\t\t\t/** @type {import(\"@prismicio/client\").Content.${pascalName}Slice} */\n\t\t\texport let slice;\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tif (typescript) {\n\t\treturn version <= 4 ? v4TS : v5TS;\n\t}\n\n\treturn version <= 4 ? v4JS : v5JS;\n}\n"],"names":["pascalCase","svelte"],"mappings":";;;;;;;AACA,IAAA,IAAA,IAAA,IAAA;AAIA,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUd,SAAU,cAAc,MAI7B;AACA,QAAM,EAAE,OAAO,YAAY,QAAA,IAAY;AAEvC,QAAM,aAAaA,WAAAA,WAAW,MAAM,IAAI;AAExC,QAAM,OAAOC,WAAAA,OAAA,OAAA,KAAM,WAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+CAKoC,gKAMxC,wBAN8B,YAMzC,WAAA;AAIJ,QAAM,OAAOA,WAAAA,OAAA,OAAA,KAAM,WAAA,CAAA,uNAKiC,0JAKrC,wBAL2B,YAKtC,WAAA;AAIJ,QAAM,OAAOA,WAAAA,OAAA,OAAA,KAAM,WAAA,CAAA;AAAA;AAAA;AAAA;AAAA,gCAIqB,sHAIzB,wBAJe,YAI1B,WAAA;AAIJ,QAAM,OAAOA,WAAAA,OAAA,OAAA,KAAM,WAAA,CAAA,oEAE0C,+IAK9C,wBALoC,YAK/C,WAAA;AAIJ,MAAI,YAAY;AACf,WAAO,WAAW,IAAI,OAAO;AAAA,EAC9B;AAEA,SAAO,WAAW,IAAI,OAAO;AAC9B;;"}
|
@@ -9,30 +9,8 @@ Placeholder component for {slice.slice_type} (variation: {slice.variation}) slic
|
|
9
9
|
<br />
|
10
10
|
<strong>You can edit this slice directly in your code editor.</strong>
|
11
11
|
<!--
|
12
|
-
š” Use Prismic MCP with your code editor
|
13
|
-
|
14
|
-
Get AI-powered help to build your slice components ā based on your actual model.
|
15
|
-
|
16
|
-
ā¶ļø Setup:
|
17
|
-
1. Add a new MCP Server in your code editor:
|
18
|
-
|
19
|
-
{
|
20
|
-
"mcpServers": {
|
21
|
-
"Prismic MCP": {
|
22
|
-
"command": "npx",
|
23
|
-
"args": ["-y", "@prismicio/mcp-server@latest"]
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
2. Select a model optimized for coding (e.g. Claude 3.7 Sonnet or similar)
|
29
|
-
|
30
|
-
ā
Then open your slice file and ask your code editor:
|
31
|
-
"Code this slice"
|
32
|
-
|
33
|
-
Your code editor reads your slice model and helps you code faster ā”
|
34
|
-
šļø Give your feedback: https://community.prismic.io/t/help-us-shape-the-future-of-slice-creation/19505
|
35
|
-
š Documentation: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
12
|
+
š” Use the Prismic MCP server with your code editor
|
13
|
+
š Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
36
14
|
-->
|
37
15
|
`;
|
38
16
|
function sliceTemplate(args) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slice-create.templates.js","sources":["../../../src/hooks/slice-create.templates.ts"],"sourcesContent":["import { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { source as svelte } from \"common-tags\";\n\nimport { pascalCase } from \"../lib/pascalCase\";\n\nconst PLACEHOLDER = `\nPlaceholder component for {slice.slice_type} (variation: {slice.variation}) slices.\n<br />\n<strong>You can edit this slice directly in your code editor.</strong>\n<!--\nš” Use
|
1
|
+
{"version":3,"file":"slice-create.templates.js","sources":["../../../src/hooks/slice-create.templates.ts"],"sourcesContent":["import { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { source as svelte } from \"common-tags\";\n\nimport { pascalCase } from \"../lib/pascalCase\";\n\nconst PLACEHOLDER = `\nPlaceholder component for {slice.slice_type} (variation: {slice.variation}) slices.\n<br />\n<strong>You can edit this slice directly in your code editor.</strong>\n<!--\nš” Use the Prismic MCP server with your code editor\nš Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server\n-->\n`;\n\nexport function sliceTemplate(args: {\n\tmodel: SharedSlice;\n\ttypescript: boolean;\n\tversion: number;\n}): string {\n\tconst { model, typescript, version } = args;\n\n\tconst pascalName = pascalCase(model.name);\n\n\tconst v5TS = svelte`\n\t\t<script lang=\"ts\">\n\t\t\timport type { Content } from '@prismicio/client';\n\t\t\timport type { SliceComponentProps } from '@prismicio/svelte';\n\n\t\t\ttype Props = SliceComponentProps<Content.${pascalName}Slice>;\n\n\t\t\tconst { slice }: Props = $props();\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v5JS = svelte`\n\t\t<script>\n\t\t\t/* @typedef {import(\"@prismicio/client\").Content} Content */\n\t\t\t/* @typedef {import(\"@prismicio/svelte\").SliceComponentProps} SliceComponentProps */\n\n\t\t\t/* @type {SliceComponentProps<Content.${pascalName}Slice>} */\n\t\t\tconst { slice } = $props();\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v4TS = svelte`\n\t\t<script lang=\"ts\">\n\t\t\timport type { Content } from '@prismicio/client';\n\n\t\t\texport let slice: Content.${pascalName}Slice;\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tconst v4JS = svelte`\n\t\t<script>\n\t\t\t/** @type {import(\"@prismicio/client\").Content.${pascalName}Slice} */\n\t\t\texport let slice;\n\t\t</script>\n\n\t\t<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>\n\t\t\t${PLACEHOLDER}\n\t\t</section>\n\t`;\n\n\tif (typescript) {\n\t\treturn version <= 4 ? v4TS : v5TS;\n\t}\n\n\treturn version <= 4 ? v4JS : v5JS;\n}\n"],"names":["svelte"],"mappings":";;;;;AACA,IAAA,IAAA,IAAA,IAAA;AAIA,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUd,SAAU,cAAc,MAI7B;AACA,QAAM,EAAE,OAAO,YAAY,QAAA,IAAY;AAEvC,QAAM,aAAa,WAAW,MAAM,IAAI;AAExC,QAAM,OAAOA,OAAA,OAAA,KAAM,WAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+CAKoC,gKAMxC,wBAN8B,YAMzC,WAAA;AAIJ,QAAM,OAAOA,OAAA,OAAA,KAAM,WAAA,CAAA,uNAKiC,0JAKrC,wBAL2B,YAKtC,WAAA;AAIJ,QAAM,OAAOA,OAAA,OAAA,KAAM,WAAA,CAAA;AAAA;AAAA;AAAA;AAAA,gCAIqB,sHAIzB,wBAJe,YAI1B,WAAA;AAIJ,QAAM,OAAOA,OAAA,OAAA,KAAM,WAAA,CAAA,oEAE0C,+IAK9C,wBALoC,YAK/C,WAAA;AAIJ,MAAI,YAAY;AACf,WAAO,WAAW,IAAI,OAAO;AAAA,EAC9B;AAEA,SAAO,WAAW,IAAI,OAAO;AAC9B;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@slicemachine/adapter-sveltekit",
|
3
|
-
"version": "0.3.85-
|
3
|
+
"version": "0.3.85-beta.1",
|
4
4
|
"description": "Slice Machine adapter for SvelteKit.",
|
5
5
|
"keywords": [
|
6
6
|
"typescript",
|
@@ -63,8 +63,8 @@
|
|
63
63
|
},
|
64
64
|
"dependencies": {
|
65
65
|
"@prismicio/simulator": "^0.1.4",
|
66
|
-
"@prismicio/types-internal": "3.
|
67
|
-
"@slicemachine/plugin-kit": "0.4.83-
|
66
|
+
"@prismicio/types-internal": "3.11.2",
|
67
|
+
"@slicemachine/plugin-kit": "0.4.83-beta.1",
|
68
68
|
"common-tags": "^1.8.2",
|
69
69
|
"fp-ts": "^2.13.1",
|
70
70
|
"io-ts": "^2.2.20",
|
@@ -8,30 +8,8 @@ Placeholder component for {slice.slice_type} (variation: {slice.variation}) slic
|
|
8
8
|
<br />
|
9
9
|
<strong>You can edit this slice directly in your code editor.</strong>
|
10
10
|
<!--
|
11
|
-
š” Use Prismic MCP with your code editor
|
12
|
-
|
13
|
-
Get AI-powered help to build your slice components ā based on your actual model.
|
14
|
-
|
15
|
-
ā¶ļø Setup:
|
16
|
-
1. Add a new MCP Server in your code editor:
|
17
|
-
|
18
|
-
{
|
19
|
-
"mcpServers": {
|
20
|
-
"Prismic MCP": {
|
21
|
-
"command": "npx",
|
22
|
-
"args": ["-y", "@prismicio/mcp-server@latest"]
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
2. Select a model optimized for coding (e.g. Claude 3.7 Sonnet or similar)
|
28
|
-
|
29
|
-
ā
Then open your slice file and ask your code editor:
|
30
|
-
"Code this slice"
|
31
|
-
|
32
|
-
Your code editor reads your slice model and helps you code faster ā”
|
33
|
-
šļø Give your feedback: https://community.prismic.io/t/help-us-shape-the-future-of-slice-creation/19505
|
34
|
-
š Documentation: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
11
|
+
š” Use the Prismic MCP server with your code editor
|
12
|
+
š Docs: https://prismic.io/docs/ai#code-with-prismics-mcp-server
|
35
13
|
-->
|
36
14
|
`;
|
37
15
|
|