@slicemachine/adapter-next 0.3.15-dev-next-release.8 → 0.3.15-dev-next-release.9

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.
Files changed (30) hide show
  1. package/dist/CustomerLogos/screenshot-default.png +0 -0
  2. package/dist/Hero/screenshot-default.png +0 -0
  3. package/dist/Hero/screenshot-imageRight.png +0 -0
  4. package/dist/hooks/sliceTemplateLibrary-read.cjs +5 -4
  5. package/dist/hooks/sliceTemplateLibrary-read.cjs.map +1 -1
  6. package/dist/hooks/sliceTemplateLibrary-read.js +5 -4
  7. package/dist/hooks/sliceTemplateLibrary-read.js.map +1 -1
  8. package/dist/sliceTemplates/AlternateGrid/index.cjs +425 -411
  9. package/dist/sliceTemplates/AlternateGrid/index.cjs.map +1 -1
  10. package/dist/sliceTemplates/AlternateGrid/index.js +425 -411
  11. package/dist/sliceTemplates/AlternateGrid/index.js.map +1 -1
  12. package/dist/sliceTemplates/CallToAction/index.cjs +2 -0
  13. package/dist/sliceTemplates/CallToAction/index.cjs.map +1 -1
  14. package/dist/sliceTemplates/CallToAction/index.js +2 -0
  15. package/dist/sliceTemplates/CallToAction/index.js.map +1 -1
  16. package/dist/sliceTemplates/CustomerLogos/index.cjs +258 -257
  17. package/dist/sliceTemplates/CustomerLogos/index.cjs.map +1 -1
  18. package/dist/sliceTemplates/CustomerLogos/index.js +258 -257
  19. package/dist/sliceTemplates/CustomerLogos/index.js.map +1 -1
  20. package/dist/sliceTemplates/Hero/index.cjs +814 -0
  21. package/dist/sliceTemplates/Hero/index.cjs.map +1 -0
  22. package/dist/sliceTemplates/Hero/index.d.ts +9 -0
  23. package/dist/sliceTemplates/Hero/index.js +814 -0
  24. package/dist/sliceTemplates/Hero/index.js.map +1 -0
  25. package/package.json +3 -3
  26. package/src/hooks/sliceTemplateLibrary-read.ts +2 -1
  27. package/src/sliceTemplates/AlternateGrid/index.ts +425 -411
  28. package/src/sliceTemplates/CallToAction/index.ts +2 -0
  29. package/src/sliceTemplates/CustomerLogos/index.ts +258 -257
  30. package/src/sliceTemplates/Hero/index.ts +824 -0
Binary file
@@ -4,10 +4,11 @@ const fs = require("node:fs/promises");
4
4
  const path = require("node:path");
5
5
  const node_url = require("node:url");
6
6
  const checkIsTypeScriptProject = require("../lib/checkIsTypeScriptProject.cjs");
7
- const index = require("../sliceTemplates/CallToAction/index.cjs");
8
- const index$1 = require("../sliceTemplates/AlternateGrid/index.cjs");
9
- const index$2 = require("../sliceTemplates/CustomerLogos/index.cjs");
10
- const initialTemplates = [index, index$1, index$2];
7
+ const index = require("../sliceTemplates/Hero/index.cjs");
8
+ const index$1 = require("../sliceTemplates/CallToAction/index.cjs");
9
+ const index$2 = require("../sliceTemplates/AlternateGrid/index.cjs");
10
+ const index$3 = require("../sliceTemplates/CustomerLogos/index.cjs");
11
+ const initialTemplates = [index, index$1, index$2, index$3];
11
12
  const sliceTemplateLibraryRead = async ({ templateIDs }, { helpers, options }) => {
12
13
  const isTypeScriptProject = await checkIsTypeScriptProject.checkIsTypeScriptProject({
13
14
  helpers,
@@ -1 +1 @@
1
- {"version":3,"file":"sliceTemplateLibrary-read.cjs","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\nimport * as CustomerLogos from \"../sliceTemplates/CustomerLogos\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction, AlternateGrid, CustomerLogos];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","AlternateGrid","CustomerLogos","checkIsTypeScriptProject","fileURLToPath","model"],"mappings":";;;;;;;;;AAeA,MAAM,mBAAmB,CAACA,OAAcC,SAAeC,OAAa;AAEvD,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACAC,SAAc,cAAA,IAAI,IAAI,KAAK,KAAK,MAAM,QAAQ,kNAAkB,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;;"}
1
+ {"version":3,"file":"sliceTemplateLibrary-read.cjs","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as Hero from \"../sliceTemplates/Hero\";\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\nimport * as CustomerLogos from \"../sliceTemplates/CustomerLogos\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [Hero, CallToAction, AlternateGrid, CustomerLogos];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["Hero","CallToAction","AlternateGrid","CustomerLogos","checkIsTypeScriptProject","fileURLToPath","model"],"mappings":";;;;;;;;;;AAgBA,MAAM,mBAAmB,CAACA,OAAMC,SAAcC,SAAeC,OAAa;AAE7D,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACAC,SAAc,cAAA,IAAI,IAAI,KAAK,KAAK,MAAM,QAAQ,kNAAkB,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;;"}
@@ -2,10 +2,11 @@ import fs from "node:fs/promises";
2
2
  import path__default from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { checkIsTypeScriptProject } from "../lib/checkIsTypeScriptProject.js";
5
- import * as index from "../sliceTemplates/CallToAction/index.js";
6
- import * as index$1 from "../sliceTemplates/AlternateGrid/index.js";
7
- import * as index$2 from "../sliceTemplates/CustomerLogos/index.js";
8
- const initialTemplates = [index, index$1, index$2];
5
+ import * as index from "../sliceTemplates/Hero/index.js";
6
+ import * as index$1 from "../sliceTemplates/CallToAction/index.js";
7
+ import * as index$2 from "../sliceTemplates/AlternateGrid/index.js";
8
+ import * as index$3 from "../sliceTemplates/CustomerLogos/index.js";
9
+ const initialTemplates = [index, index$1, index$2, index$3];
9
10
  const sliceTemplateLibraryRead = async ({ templateIDs }, { helpers, options }) => {
10
11
  const isTypeScriptProject = await checkIsTypeScriptProject({
11
12
  helpers,
@@ -1 +1 @@
1
- {"version":3,"file":"sliceTemplateLibrary-read.js","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\nimport * as CustomerLogos from \"../sliceTemplates/CustomerLogos\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction, AlternateGrid, CustomerLogos];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","AlternateGrid","CustomerLogos","path","model"],"mappings":";;;;;;;AAeA,MAAM,mBAAmB,CAACA,OAAcC,SAAeC,OAAa;AAEvD,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACA,cAAc,IAAI,IAAIC,cAAK,KAAK,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;"}
1
+ {"version":3,"file":"sliceTemplateLibrary-read.js","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as Hero from \"../sliceTemplates/Hero\";\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\nimport * as CustomerLogos from \"../sliceTemplates/CustomerLogos\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [Hero, CallToAction, AlternateGrid, CustomerLogos];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["Hero","CallToAction","AlternateGrid","CustomerLogos","path","model"],"mappings":";;;;;;;;AAgBA,MAAM,mBAAmB,CAACA,OAAMC,SAAcC,SAAeC,OAAa;AAE7D,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACA,cAAc,IAAI,IAAIC,cAAK,KAAK,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;"}