@slicemachine/adapter-nuxt2 0.3.84-beta.4 → 0.3.84-beta.6
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/dist/_node_modules/@prismicio/simulator/dist/SimulatorAPI.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/SimulatorAPI.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelNetwork.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelNetwork.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelReceiver.cjs +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelReceiver.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelReceiver.js +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/ChannelReceiver.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/errors.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/errors.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/messages.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/messages.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/types.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/channel/types.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/SimulatorManager.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/SimulatorManager.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/State.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/State.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/domHelpers.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/domHelpers.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/eventHandlers.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/eventHandlers.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/getDefault.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/getDefault.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/messages.cjs +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/messages.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/messages.js +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/messages.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/kit/types.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/EventEmitter.cjs +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/EventEmitter.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/EventEmitter.js +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/EventEmitter.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/throttle.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/lib/throttle.js.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/types.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/simulator/dist/types.js.map +1 -1
- package/dist/_node_modules/statuses/index.cjs.map +1 -1
- package/dist/_node_modules/statuses/index.js.map +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/hooks/documentation-read.cjs +1 -1
- package/dist/hooks/documentation-read.cjs.map +1 -1
- package/dist/hooks/documentation-read.js +1 -1
- package/dist/hooks/documentation-read.js.map +1 -1
- package/dist/hooks/project-init.cjs +1 -1
- package/dist/hooks/project-init.cjs.map +1 -1
- package/dist/hooks/project-init.js +1 -1
- package/dist/hooks/project-init.js.map +1 -1
- package/dist/hooks/slice-create.cjs.map +1 -1
- package/dist/hooks/slice-create.js.map +1 -1
- package/dist/hooks/snippet-read.cjs.map +1 -1
- package/dist/hooks/snippet-read.js.map +1 -1
- package/dist/lib/buildSrcPath.cjs.map +1 -1
- package/dist/lib/buildSrcPath.js.map +1 -1
- package/dist/lib/checkIsTypeScriptProject.cjs.map +1 -1
- package/dist/lib/checkIsTypeScriptProject.js.map +1 -1
- package/dist/lib/getJSFileExtension.cjs.map +1 -1
- package/dist/lib/getJSFileExtension.js.map +1 -1
- package/dist/lib/pascalCase.cjs.map +1 -1
- package/dist/lib/pascalCase.js.map +1 -1
- package/dist/lib/rejectIfNecessary.cjs.map +1 -1
- package/dist/lib/rejectIfNecessary.js.map +1 -1
- package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -1
- package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/simulator/SliceSimulator.cjs.map +1 -1
- package/dist/simulator/SliceSimulator.js +2 -2
- package/dist/simulator/SliceSimulator.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/kit/messages.js"],"sourcesContent":["const div = (content) => `<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`;\nconst a = (href, label) => `<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`;\nconst header = \" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\";\nconst footer = \"\\n\\n\\n\\n\\n\\n - The Prismic team\";\nconst sliceSimulatorAccessedDirectly = div([\n header,\n `You're seeing this page because you're accessing Slice simulator\ndirectly, e.g:\n\n - ${a(\"http://localhost:3000/slice-simulator\")}\n\n\n\nThe Slice simulator can only be accessed through Slice Machine or the\nPage Builder. To preview your Slices, head over to Slice Machine:\n\n - ${a(\"http://localhost:9999\")}\n\n\n\nIf you believe this is an error, please reach out to us:\n\n - ${a(\"https://github.com/prismicio/slice-machine/issues/new/choose\")}`,\n footer\n].join(\"\"));\nexport {\n sliceSimulatorAccessedDirectly\n};\n//# sourceMappingURL=messages.js.map\n"],"names":[],"mappings":"AAAA,MAAM,MAAM,CAAC,YAAY,mLAAmL,OAAO;AACnN,MAAM,IAAI,CAAC,MAAM,UAAU,YAAY,IAAI,
|
|
1
|
+
{"version":3,"file":"messages.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/kit/messages.js"],"sourcesContent":["const div = (content) => `<div style=\"word-spacing: initial; white-space: pre; line-height: initial; font-family: monospace; color: #ffffff; mix-blend-mode: difference; padding: 1rem; font-size: 1rem;\">${content}</div>`;\nconst a = (href, label) => `<a href=\"${href}\" style=\"text-decoration: underline;\">${label || href}<a>`;\nconst header = \" _____ ___ _____ _ __ __ \\n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\\n \\\\__ \\\\/ / / ___/ _ \\\\\\\\__ \\\\/ / __ `__ \\\\/ / / / / __ `/ __/ __ \\\\/ ___/\\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \\n/____/_/_/\\\\___/\\\\___/____/_/_/ /_/ /_/\\\\__,_/_/\\\\__,_/\\\\__/\\\\____/_/ \\n / /_ __ __ / __ \\\\_____(_)________ ___ (_)____\\n / __ \\\\/ / / / / /_/ / ___/ / ___/ __ `__ \\\\/ / ___/\\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \\n /_.___/\\\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\\\___/ \\n /____/\\n\\n\";\nconst footer = \"\\n\\n\\n\\n\\n\\n - The Prismic team\";\nconst sliceSimulatorAccessedDirectly = div([\n header,\n `You're seeing this page because you're accessing Slice simulator\ndirectly, e.g:\n\n - ${a(\"http://localhost:3000/slice-simulator\")}\n\n\n\nThe Slice simulator can only be accessed through Slice Machine or the\nPage Builder. To preview your Slices, head over to Slice Machine:\n\n - ${a(\"http://localhost:9999\")}\n\n\n\nIf you believe this is an error, please reach out to us:\n\n - ${a(\"https://github.com/prismicio/slice-machine/issues/new/choose\")}`,\n footer\n].join(\"\"));\nexport {\n sliceSimulatorAccessedDirectly\n};\n//# sourceMappingURL=messages.js.map\n"],"names":[],"mappings":"AAAA,MAAM,MAAM,CAAC,YAAY,mLAAmL,OAAO;AACnN,MAAM,IAAI,CAAC,MAAM,UAAU,YAAY,IAAI,yCAAkD,IAAI;AACjG,MAAM,SAAS;AACf,MAAM,SAAS;AACV,MAAC,iCAAiC,IAAI;AAAA,EACzC;AAAA,EACA;AAAA;AAAA;AAAA,MAGI,EAAE,uCAAuC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAO1C,EAAE,uBAAuB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM1B,EAAE,8DAA8D,CAAC;AAAA,EACrE;AACF,EAAE,KAAK,EAAE,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/kit/types.js"],"sourcesContent":["var StateEventType;\n(function(StateEventType2) {\n StateEventType2[\"Slices\"] = \"slices\";\n StateEventType2[\"ActiveSlice\"] = \"activeSlice\";\n StateEventType2[\"Message\"] = \"message\";\n})(StateEventType || (StateEventType = {}));\nexport {\n StateEventType\n};\n//# sourceMappingURL=types.js.map\n"],"names":["StateEventType"],"mappings":";;AAAIA,
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/kit/types.js"],"sourcesContent":["var StateEventType;\n(function(StateEventType2) {\n StateEventType2[\"Slices\"] = \"slices\";\n StateEventType2[\"ActiveSlice\"] = \"activeSlice\";\n StateEventType2[\"Message\"] = \"message\";\n})(StateEventType || (StateEventType = {}));\nexport {\n StateEventType\n};\n//# sourceMappingURL=types.js.map\n"],"names":["StateEventType"],"mappings":";;AAAIA,QAAAA,iBAAAA;AAAAA,CACH,SAAS,iBAAiB;AACzB,kBAAgB,QAAQ,IAAI;AAC5B,kBAAgB,aAAa,IAAI;AACjC,kBAAgB,SAAS,IAAI;AAC/B,GAAGA,QAAAA,mBAAmBA,yBAAiB,CAAA,EAAG;","x_google_ignoreList":[0]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
5
|
var __publicField = (obj, key, value) => {
|
|
6
|
-
__defNormalProp(obj,
|
|
6
|
+
__defNormalProp(obj, key + "", value);
|
|
7
7
|
return value;
|
|
8
8
|
};
|
|
9
9
|
class EventEmitter {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/EventEmitter.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass EventEmitter {\n constructor() {\n __publicField(this, \"_listeners\", {});\n }\n on(event, listener, key = null) {\n this._listeners[event] = [\n ...this._listeners[event] ?? [],\n [listener, key]\n ];\n }\n off(event, listenerOrKey) {\n this._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) => typeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey);\n }\n emit(event, payload) {\n (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));\n }\n}\nexport {\n EventEmitter\n};\n//# sourceMappingURL=EventEmitter.js.map\n"],"names":[],"mappings":";;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"EventEmitter.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/EventEmitter.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass EventEmitter {\n constructor() {\n __publicField(this, \"_listeners\", {});\n }\n on(event, listener, key = null) {\n this._listeners[event] = [\n ...this._listeners[event] ?? [],\n [listener, key]\n ];\n }\n off(event, listenerOrKey) {\n this._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) => typeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey);\n }\n emit(event, payload) {\n (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));\n }\n}\nexport {\n EventEmitter\n};\n//# sourceMappingURL=EventEmitter.js.map\n"],"names":[],"mappings":";;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAK,CAAE,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU;AACvC,kBAAgB,KAA+B,MAAM,IAAU,KAAK;AACpE,SAAO;AACT;AACA,MAAM,aAAa;AAAA,EACjB,cAAc;AACZ,kBAAc,MAAM,cAAc,EAAE;AAAA,EACtC;AAAA,EACA,GAAG,OAAO,UAAU,MAAM,MAAM;AAC9B,SAAK,WAAW,KAAK,IAAI;AAAA,MACvB,GAAG,KAAK,WAAW,KAAK,KAAK,CAAA;AAAA,MAC7B,CAAC,UAAU,GAAG;AAAA,IACpB;AAAA,EACE;AAAA,EACA,IAAI,OAAO,eAAe;AACxB,SAAK,WAAW,KAAK,KAAK,KAAK,WAAW,KAAK,KAAK,CAAA,GAAI,OAAO,CAAC,CAAC,UAAU,GAAG,MAAM,OAAO,kBAAkB,aAAa,aAAa,gBAAgB,QAAQ,aAAa;AAAA,EAC9K;AAAA,EACA,KAAK,OAAO,SAAS;AACnB,KAAC,KAAK,WAAW,KAAK,KAAK,CAAA,GAAI,QAAQ,CAAC,aAAa,SAAS,CAAC,EAAE,OAAO,CAAC;AAAA,EAC3E;AACF;;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj,
|
|
4
|
+
__defNormalProp(obj, key + "", value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
class EventEmitter {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/EventEmitter.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass EventEmitter {\n constructor() {\n __publicField(this, \"_listeners\", {});\n }\n on(event, listener, key = null) {\n this._listeners[event] = [\n ...this._listeners[event] ?? [],\n [listener, key]\n ];\n }\n off(event, listenerOrKey) {\n this._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) => typeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey);\n }\n emit(event, payload) {\n (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));\n }\n}\nexport {\n EventEmitter\n};\n//# sourceMappingURL=EventEmitter.js.map\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"EventEmitter.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/EventEmitter.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass EventEmitter {\n constructor() {\n __publicField(this, \"_listeners\", {});\n }\n on(event, listener, key = null) {\n this._listeners[event] = [\n ...this._listeners[event] ?? [],\n [listener, key]\n ];\n }\n off(event, listenerOrKey) {\n this._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) => typeof listenerOrKey === \"function\" ? listener !== listenerOrKey : key !== listenerOrKey);\n }\n emit(event, payload) {\n (this._listeners[event] ?? []).forEach((listener) => listener[0](payload));\n }\n}\nexport {\n EventEmitter\n};\n//# sourceMappingURL=EventEmitter.js.map\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAK,CAAE,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU;AACvC,kBAAgB,KAA+B,MAAM,IAAU,KAAK;AACpE,SAAO;AACT;AACA,MAAM,aAAa;AAAA,EACjB,cAAc;AACZ,kBAAc,MAAM,cAAc,EAAE;AAAA,EACtC;AAAA,EACA,GAAG,OAAO,UAAU,MAAM,MAAM;AAC9B,SAAK,WAAW,KAAK,IAAI;AAAA,MACvB,GAAG,KAAK,WAAW,KAAK,KAAK,CAAA;AAAA,MAC7B,CAAC,UAAU,GAAG;AAAA,IACpB;AAAA,EACE;AAAA,EACA,IAAI,OAAO,eAAe;AACxB,SAAK,WAAW,KAAK,KAAK,KAAK,WAAW,KAAK,KAAK,CAAA,GAAI,OAAO,CAAC,CAAC,UAAU,GAAG,MAAM,OAAO,kBAAkB,aAAa,aAAa,gBAAgB,QAAQ,aAAa;AAAA,EAC9K;AAAA,EACA,KAAK,OAAO,SAAS;AACnB,KAAC,KAAK,WAAW,KAAK,KAAK,CAAA,GAAI,QAAQ,CAAC,aAAa,SAAS,CAAC,EAAE,OAAO,CAAC;AAAA,EAC3E;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/throttle.js"],"sourcesContent":["const throttle = (fn, delay = 16) => {\n let lastExec = 0;\n let timer = null;\n return function(...args) {\n const now = Date.now();\n const delta = now - lastExec;\n if (delta >= delay) {\n fn.apply(this, args);\n lastExec = now;\n } else {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n lastExec = Date.now();\n }, delay - delta);\n }\n };\n};\nexport {\n throttle\n};\n//# sourceMappingURL=throttle.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,WAAW,CAAC,IAAI,QAAQ,OAAO;AACnC,MAAI,WAAW;AACf,MAAI,QAAQ;AACZ,SAAO,YAAY,MAAM;AACvB,UAAM,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"throttle.cjs","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/throttle.js"],"sourcesContent":["const throttle = (fn, delay = 16) => {\n let lastExec = 0;\n let timer = null;\n return function(...args) {\n const now = Date.now();\n const delta = now - lastExec;\n if (delta >= delay) {\n fn.apply(this, args);\n lastExec = now;\n } else {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n lastExec = Date.now();\n }, delay - delta);\n }\n };\n};\nexport {\n throttle\n};\n//# sourceMappingURL=throttle.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,WAAW,CAAC,IAAI,QAAQ,OAAO;AACnC,MAAI,WAAW;AACf,MAAI,QAAQ;AACZ,SAAO,YAAY,MAAM;AACvB,UAAM,MAAM,KAAK,IAAG;AACpB,UAAM,QAAQ,MAAM;AACpB,QAAI,SAAS,OAAO;AAClB,SAAG,MAAM,MAAM,IAAI;AACnB,iBAAW;AAAA,IACb,OAAO;AACL,UAAI,OAAO;AACT,qBAAa,KAAK;AAAA,MACpB;AACA,cAAQ,WAAW,MAAM;AACvB,WAAG,MAAM,MAAM,IAAI;AACnB,mBAAW,KAAK,IAAG;AAAA,MACrB,GAAG,QAAQ,KAAK;AAAA,IAClB;AAAA,EACF;AACF;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/throttle.js"],"sourcesContent":["const throttle = (fn, delay = 16) => {\n let lastExec = 0;\n let timer = null;\n return function(...args) {\n const now = Date.now();\n const delta = now - lastExec;\n if (delta >= delay) {\n fn.apply(this, args);\n lastExec = now;\n } else {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n lastExec = Date.now();\n }, delay - delta);\n }\n };\n};\nexport {\n throttle\n};\n//# sourceMappingURL=throttle.js.map\n"],"names":[],"mappings":"AAAK,MAAC,WAAW,CAAC,IAAI,QAAQ,OAAO;AACnC,MAAI,WAAW;AACf,MAAI,QAAQ;AACZ,SAAO,YAAY,MAAM;AACvB,UAAM,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"throttle.js","sources":["../../../../../../../../node_modules/@prismicio/simulator/dist/lib/throttle.js"],"sourcesContent":["const throttle = (fn, delay = 16) => {\n let lastExec = 0;\n let timer = null;\n return function(...args) {\n const now = Date.now();\n const delta = now - lastExec;\n if (delta >= delay) {\n fn.apply(this, args);\n lastExec = now;\n } else {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n lastExec = Date.now();\n }, delay - delta);\n }\n };\n};\nexport {\n throttle\n};\n//# sourceMappingURL=throttle.js.map\n"],"names":[],"mappings":"AAAK,MAAC,WAAW,CAAC,IAAI,QAAQ,OAAO;AACnC,MAAI,WAAW;AACf,MAAI,QAAQ;AACZ,SAAO,YAAY,MAAM;AACvB,UAAM,MAAM,KAAK,IAAG;AACpB,UAAM,QAAQ,MAAM;AACpB,QAAI,SAAS,OAAO;AAClB,SAAG,MAAM,MAAM,IAAI;AACnB,iBAAW;AAAA,IACb,OAAO;AACL,UAAI,OAAO;AACT,qBAAa,KAAK;AAAA,MACpB;AACA,cAAQ,WAAW,MAAM;AACvB,WAAG,MAAM,MAAM,IAAI;AACnB,mBAAW,KAAK,IAAG;AAAA,MACrB,GAAG,QAAQ,KAAK;AAAA,IAClB;AAAA,EACF;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../../../../node_modules/@prismicio/simulator/dist/types.js"],"sourcesContent":["var APIRequestType;\n(function(APIRequestType2) {\n APIRequestType2[\"SetActiveSlice\"] = \"setActiveSlice\";\n APIRequestType2[\"SetSliceZoneSize\"] = \"setSliceZoneSize\";\n})(APIRequestType || (APIRequestType = {}));\nvar ClientRequestType;\n(function(ClientRequestType2) {\n ClientRequestType2[\"Ping\"] = \"ping\";\n ClientRequestType2[\"SetSliceZone\"] = \"setSliceZone\";\n ClientRequestType2[\"ScrollToSlice\"] = \"scrollToSlice\";\n})(ClientRequestType || (ClientRequestType = {}));\nexport {\n APIRequestType,\n ClientRequestType\n};\n//# sourceMappingURL=types.js.map\n"],"names":["APIRequestType","ClientRequestType"],"mappings":";;AAAIA,
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../../../../node_modules/@prismicio/simulator/dist/types.js"],"sourcesContent":["var APIRequestType;\n(function(APIRequestType2) {\n APIRequestType2[\"SetActiveSlice\"] = \"setActiveSlice\";\n APIRequestType2[\"SetSliceZoneSize\"] = \"setSliceZoneSize\";\n})(APIRequestType || (APIRequestType = {}));\nvar ClientRequestType;\n(function(ClientRequestType2) {\n ClientRequestType2[\"Ping\"] = \"ping\";\n ClientRequestType2[\"SetSliceZone\"] = \"setSliceZone\";\n ClientRequestType2[\"ScrollToSlice\"] = \"scrollToSlice\";\n})(ClientRequestType || (ClientRequestType = {}));\nexport {\n APIRequestType,\n ClientRequestType\n};\n//# sourceMappingURL=types.js.map\n"],"names":["APIRequestType","ClientRequestType"],"mappings":";;AAAIA,QAAAA,iBAAAA;AAAAA,CACH,SAAS,iBAAiB;AACzB,kBAAgB,gBAAgB,IAAI;AACpC,kBAAgB,kBAAkB,IAAI;AACxC,GAAGA,QAAAA,mBAAmBA,yBAAiB,CAAA,EAAG;AACtCC,QAAAA,oBAAAA;AAAAA,CACH,SAAS,oBAAoB;AAC5B,qBAAmB,MAAM,IAAI;AAC7B,qBAAmB,cAAc,IAAI;AACrC,qBAAmB,eAAe,IAAI;AACxC,GAAGA,QAAAA,sBAAsBA,4BAAoB,CAAA,EAAG;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../../node_modules/@prismicio/simulator/dist/types.js"],"sourcesContent":["var APIRequestType;\n(function(APIRequestType2) {\n APIRequestType2[\"SetActiveSlice\"] = \"setActiveSlice\";\n APIRequestType2[\"SetSliceZoneSize\"] = \"setSliceZoneSize\";\n})(APIRequestType || (APIRequestType = {}));\nvar ClientRequestType;\n(function(ClientRequestType2) {\n ClientRequestType2[\"Ping\"] = \"ping\";\n ClientRequestType2[\"SetSliceZone\"] = \"setSliceZone\";\n ClientRequestType2[\"ScrollToSlice\"] = \"scrollToSlice\";\n})(ClientRequestType || (ClientRequestType = {}));\nexport {\n APIRequestType,\n ClientRequestType\n};\n//# sourceMappingURL=types.js.map\n"],"names":[],"mappings":"AAAG,IAAC;AAAA,CACH,SAAS,iBAAiB;AACzB,kBAAgB,gBAAgB,IAAI;AACpC,kBAAgB,kBAAkB,IAAI;AACxC,GAAG,mBAAmB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../../node_modules/@prismicio/simulator/dist/types.js"],"sourcesContent":["var APIRequestType;\n(function(APIRequestType2) {\n APIRequestType2[\"SetActiveSlice\"] = \"setActiveSlice\";\n APIRequestType2[\"SetSliceZoneSize\"] = \"setSliceZoneSize\";\n})(APIRequestType || (APIRequestType = {}));\nvar ClientRequestType;\n(function(ClientRequestType2) {\n ClientRequestType2[\"Ping\"] = \"ping\";\n ClientRequestType2[\"SetSliceZone\"] = \"setSliceZone\";\n ClientRequestType2[\"ScrollToSlice\"] = \"scrollToSlice\";\n})(ClientRequestType || (ClientRequestType = {}));\nexport {\n APIRequestType,\n ClientRequestType\n};\n//# sourceMappingURL=types.js.map\n"],"names":[],"mappings":"AAAG,IAAC;AAAA,CACH,SAAS,iBAAiB;AACzB,kBAAgB,gBAAgB,IAAI;AACpC,kBAAgB,kBAAkB,IAAI;AACxC,GAAG,mBAAmB,iBAAiB,CAAA,EAAG;AACvC,IAAC;AAAA,CACH,SAAS,oBAAoB;AAC5B,qBAAmB,MAAM,IAAI;AAC7B,qBAAmB,cAAc,IAAI;AACrC,qBAAmB,eAAe,IAAI;AACxC,GAAG,sBAAsB,oBAAoB,CAAA,EAAG;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../node_modules/statuses/index.js"],"sourcesContent":["/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n"],"names":["require$$0","codes","status"],"mappings":";;;;;;;;;AAcA,IAAI,QAAQA;AAOZ,IAAA,WAAiB;AAGjB,OAAO,UAAU;AAGjB,OAAO,OAAO,6BAA6B,KAAK;AAGhD,OAAO,QAAQ,qBAAqB,KAAK;AAGzC,OAAO,WAAW;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAOA,SAAS,6BAA8BC,QAAO;AAC5C,MAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../node_modules/statuses/index.js"],"sourcesContent":["/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n"],"names":["require$$0","codes","status"],"mappings":";;;;;;;;;AAcA,IAAI,QAAQA;AAOZ,IAAA,WAAiB;AAGjB,OAAO,UAAU;AAGjB,OAAO,OAAO,6BAA6B,KAAK;AAGhD,OAAO,QAAQ,qBAAqB,KAAK;AAGzC,OAAO,WAAW;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAOA,SAAS,6BAA8BC,QAAO;AAC5C,MAAI,MAAM,CAAA;AAEV,SAAO,KAAKA,MAAK,EAAE,QAAQ,SAAS,YAAa,MAAM;AACrD,QAAI,UAAUA,OAAM,IAAI;AACxB,QAAIC,UAAS,OAAO,IAAI;AAGxB,QAAI,QAAQ,YAAW,CAAE,IAAIA;AAAA,EACjC,CAAG;AAED,SAAO;AACT;AAOA,SAAS,qBAAsBD,QAAO;AACpC,SAAO,OAAO,KAAKA,MAAK,EAAE,IAAI,SAAS,QAAS,MAAM;AACpD,WAAO,OAAO,IAAI;AAAA,EACtB,CAAG;AACH;AAOA,SAAS,cAAe,SAAS;AAC/B,MAAI,MAAM,QAAQ,YAAW;AAE7B,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,MAAM,GAAG,GAAG;AAC3D,UAAM,IAAI,MAAM,8BAA8B,UAAU,GAAG;AAAA,EAC/D;AAEE,SAAO,OAAO,KAAK,GAAG;AACxB;AAOA,SAAS,iBAAkB,MAAM;AAC/B,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,SAAS,IAAI,GAAG;AAC/D,UAAM,IAAI,MAAM,0BAA0B,IAAI;AAAA,EAClD;AAEE,SAAO,OAAO,QAAQ,IAAI;AAC5B;AAgBA,SAAS,OAAQ,MAAM;AACrB,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,iBAAiB,IAAI;AAAA,EAChC;AAEE,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,IAAI,UAAU,iCAAiC;AAAA,EACzD;AAGE,MAAI,IAAI,SAAS,MAAM,EAAE;AACzB,MAAI,CAAC,MAAM,CAAC,GAAG;AACb,WAAO,iBAAiB,CAAC;AAAA,EAC7B;AAEE,SAAO,cAAc,IAAI;AAC3B;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/statuses/index.js"],"sourcesContent":["/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n"],"names":["codes","status"],"mappings":";;;;;;;;AAcA,IAAI,QAAQ;AAOZ,IAAA,WAAiB;AAGjB,OAAO,UAAU;AAGjB,OAAO,OAAO,6BAA6B,KAAK;AAGhD,OAAO,QAAQ,qBAAqB,KAAK;AAGzC,OAAO,WAAW;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAOA,SAAS,6BAA8BA,QAAO;AAC5C,MAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/statuses/index.js"],"sourcesContent":["/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n"],"names":["codes","status"],"mappings":";;;;;;;;AAcA,IAAI,QAAQ;AAOZ,IAAA,WAAiB;AAGjB,OAAO,UAAU;AAGjB,OAAO,OAAO,6BAA6B,KAAK;AAGhD,OAAO,QAAQ,qBAAqB,KAAK;AAGzC,OAAO,WAAW;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGA,OAAO,QAAQ;AAAA,EACb,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAOA,SAAS,6BAA8BA,QAAO;AAC5C,MAAI,MAAM,CAAA;AAEV,SAAO,KAAKA,MAAK,EAAE,QAAQ,SAAS,YAAa,MAAM;AACrD,QAAI,UAAUA,OAAM,IAAI;AACxB,QAAIC,UAAS,OAAO,IAAI;AAGxB,QAAI,QAAQ,YAAW,CAAE,IAAIA;AAAA,EACjC,CAAG;AAED,SAAO;AACT;AAOA,SAAS,qBAAsBD,QAAO;AACpC,SAAO,OAAO,KAAKA,MAAK,EAAE,IAAI,SAAS,QAAS,MAAM;AACpD,WAAO,OAAO,IAAI;AAAA,EACtB,CAAG;AACH;AAOA,SAAS,cAAe,SAAS;AAC/B,MAAI,MAAM,QAAQ,YAAW;AAE7B,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,MAAM,GAAG,GAAG;AAC3D,UAAM,IAAI,MAAM,8BAA8B,UAAU,GAAG;AAAA,EAC/D;AAEE,SAAO,OAAO,KAAK,GAAG;AACxB;AAOA,SAAS,iBAAkB,MAAM;AAC/B,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,SAAS,IAAI,GAAG;AAC/D,UAAM,IAAI,MAAM,0BAA0B,IAAI;AAAA,EAClD;AAEE,SAAO,OAAO,QAAQ,IAAI;AAC5B;AAgBA,SAAS,OAAQ,MAAM;AACrB,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,iBAAiB,IAAI;AAAA,EAChC;AAEE,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,IAAI,UAAU,iCAAiC;AAAA,EACzD;AAGE,MAAI,IAAI,SAAS,MAAM,EAAE;AACzB,MAAI,CAAC,MAAM,CAAC,GAAG;AACb,WAAO,iBAAiB,CAAC;AAAA,EAC7B;AAEE,SAAO,cAAc,IAAI;AAC3B;;","x_google_ignoreList":[0]}
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n\n/**\n * The default file path at which environment variables will be stored.\n */\nexport const DEFAULT_ENVIRONMENT_VARIABLE_FILE_PATH = \".env\";\n\n/**\n * The file paths at which environment variables will be read in order from\n * lowest priority to highest priority.\n */\nexport const ENVIRONMENT_VARIABLE_PATHS = [\".env\"];\n\n/**\n * The name of the environment variable that stores the active Prismic\n * environment.\n */\nexport const PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME =\n\t\"NUXT_PUBLIC_PRISMIC_ENVIRONMENT\";\n"],"names":[],"mappings":";;AAGO,MAAM,2BACZ;AAKM,MAAM,yCAAyC;
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n\n/**\n * The default file path at which environment variables will be stored.\n */\nexport const DEFAULT_ENVIRONMENT_VARIABLE_FILE_PATH = \".env\";\n\n/**\n * The file paths at which environment variables will be read in order from\n * lowest priority to highest priority.\n */\nexport const ENVIRONMENT_VARIABLE_PATHS = [\".env\"];\n\n/**\n * The name of the environment variable that stores the active Prismic\n * environment.\n */\nexport const PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME =\n\t\"NUXT_PUBLIC_PRISMIC_ENVIRONMENT\";\n"],"names":[],"mappings":";;AAGO,MAAM,2BACZ;AAKM,MAAM,yCAAyC;AAM/C,MAAM,6BAA6B,CAAC,MAAM;AAM1C,MAAM,gDACZ;;;;;"}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n\n/**\n * The default file path at which environment variables will be stored.\n */\nexport const DEFAULT_ENVIRONMENT_VARIABLE_FILE_PATH = \".env\";\n\n/**\n * The file paths at which environment variables will be read in order from\n * lowest priority to highest priority.\n */\nexport const ENVIRONMENT_VARIABLE_PATHS = [\".env\"];\n\n/**\n * The name of the environment variable that stores the active Prismic\n * environment.\n */\nexport const PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME =\n\t\"NUXT_PUBLIC_PRISMIC_ENVIRONMENT\";\n"],"names":[],"mappings":"AAGO,MAAM,2BACZ;AAKM,MAAM,yCAAyC;
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n\n/**\n * The default file path at which environment variables will be stored.\n */\nexport const DEFAULT_ENVIRONMENT_VARIABLE_FILE_PATH = \".env\";\n\n/**\n * The file paths at which environment variables will be read in order from\n * lowest priority to highest priority.\n */\nexport const ENVIRONMENT_VARIABLE_PATHS = [\".env\"];\n\n/**\n * The name of the environment variable that stores the active Prismic\n * environment.\n */\nexport const PRISMIC_ENVIRONMENT_ENVIRONMENT_VARIABLE_NAME =\n\t\"NUXT_PUBLIC_PRISMIC_ENVIRONMENT\";\n"],"names":[],"mappings":"AAGO,MAAM,2BACZ;AAKM,MAAM,yCAAyC;AAM/C,MAAM,6BAA6B,CAAC,MAAM;AAM1C,MAAM,gDACZ;"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const commonTags = require("common-tags");
|
|
4
4
|
var __freeze = Object.freeze;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(
|
|
6
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const documentationRead = async (data, { options, helpers }) => {
|
|
9
9
|
if (data.kind === "PageSnippet") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentation-read.cjs","sources":["../../../src/hooks/documentation-read.ts"],"sourcesContent":["import { source, stripIndent } from \"common-tags\";\n\nimport type { DocumentationReadHook } from \"@slicemachine/plugin-kit\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const documentationRead: DocumentationReadHook<PluginOptions> = async (\n\tdata,\n\t{ options, helpers },\n) => {\n\tif (data.kind === \"PageSnippet\") {\n\t\tconst { model } = data.data;\n\t\tconst filePath = `${model.repeatable ? \"_uid\" : model.id}.vue`;\n\n\t\tlet fileContent: string;\n\n\t\tif (model.repeatable) {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic, params }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getByUID(\"${model.id}\", params.uid);\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t} else {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getSingle(\"${model.id}\");\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t}\n\n\t\tif (options.format) {\n\t\t\tfileContent = await helpers.format(\n\t\t\t\tfileContent,\n\t\t\t\thelpers.joinPathFromRoot(\"index.vue\"),\n\t\t\t\t{\n\t\t\t\t\tprettier: { parser: \"vue\" },\n\t\t\t\t\tincludeNewlineAtEnd: false,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: \"Options API\",\n\t\t\t\tcontent: source`\n\t\t\t\t\t## Create your ${model.label}'s page component\n\n\t\t\t\t\tAdd a new route by creating an \\`~/pages/${filePath}\\` file. (If the route should be nested in a child directory, you can create the file in a directory, like \\`~/pages/marketing/${filePath}\\`.)\n\n\t\t\t\t\tPaste in this code:\n\n\t\t\t\t\t${`~~~vue [~/pages/${filePath}]\\n${fileContent}\\n~~~`}\n\n\t\t\t\t\tMake sure all of your import paths are correct. See the [install guide](https://prismic.io/docs/nuxt-setup) for more information.\n\t\t\t\t`,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n"],"names":["stripIndent","source"],"mappings":";;;;;;AAAA,IAAA,IAAA;AAMO,MAAM,oBAA0D,OACtE,MACA,EAAE,SAAS,cACR;
|
|
1
|
+
{"version":3,"file":"documentation-read.cjs","sources":["../../../src/hooks/documentation-read.ts"],"sourcesContent":["import { source, stripIndent } from \"common-tags\";\n\nimport type { DocumentationReadHook } from \"@slicemachine/plugin-kit\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const documentationRead: DocumentationReadHook<PluginOptions> = async (\n\tdata,\n\t{ options, helpers },\n) => {\n\tif (data.kind === \"PageSnippet\") {\n\t\tconst { model } = data.data;\n\t\tconst filePath = `${model.repeatable ? \"_uid\" : model.id}.vue`;\n\n\t\tlet fileContent: string;\n\n\t\tif (model.repeatable) {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic, params }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getByUID(\"${model.id}\", params.uid);\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t} else {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getSingle(\"${model.id}\");\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t}\n\n\t\tif (options.format) {\n\t\t\tfileContent = await helpers.format(\n\t\t\t\tfileContent,\n\t\t\t\thelpers.joinPathFromRoot(\"index.vue\"),\n\t\t\t\t{\n\t\t\t\t\tprettier: { parser: \"vue\" },\n\t\t\t\t\tincludeNewlineAtEnd: false,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: \"Options API\",\n\t\t\t\tcontent: source`\n\t\t\t\t\t## Create your ${model.label}'s page component\n\n\t\t\t\t\tAdd a new route by creating an \\`~/pages/${filePath}\\` file. (If the route should be nested in a child directory, you can create the file in a directory, like \\`~/pages/marketing/${filePath}\\`.)\n\n\t\t\t\t\tPaste in this code:\n\n\t\t\t\t\t${`~~~vue [~/pages/${filePath}]\\n${fileContent}\\n~~~`}\n\n\t\t\t\t\tMake sure all of your import paths are correct. See the [install guide](https://prismic.io/docs/nuxt-setup) for more information.\n\t\t\t\t`,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n"],"names":["stripIndent","source"],"mappings":";;;;;;AAAA,IAAA,IAAA;AAMO,MAAM,oBAA0D,OACtE,MACA,EAAE,SAAS,cACR;AACH,MAAI,KAAK,SAAS,eAAe;AAChC,UAAM,EAAE,UAAU,KAAK;AACvB,UAAM,WAAW,GAAG,MAAM,aAAa,SAAS,MAAM,EAAE;AAExD,QAAI;AAEJ,QAAI,MAAM,YAAY;AACrB,oBAAcA,WAAAA,YAAA,OAAA,KAAW,WAAA,CAAA,iSAU8B,8WAAA,CAAA,IAAR,MAAM,EAAA;AAAA,IAoBtD,OAAO;AACN,oBAAcA,WAAAA,YAAA,OAAA,KAAW,WAAA,CAAA,0RAU+B,kWAAA,CAAA,IAAR,MAAM,EAAA;AAAA,IAoBvD;AAEA,QAAI,QAAQ,QAAQ;AACnB,oBAAc,MAAM,QAAQ,OAC3B,aACA,QAAQ,iBAAiB,WAAW,GACpC;AAAA,QACC,UAAU,EAAE,QAAQ,MAAA;AAAA,QACpB,qBAAqB;AAAA,MAAA,CACrB;AAAA,IAEH;AAEA,WAAO;AAAA,MACN;AAAA,QACC,OAAO;AAAA,QACP,SAASC,WAAAA;AAAAA,sBACS,MAAM,KAAK;AAAA;AAAA,gDAEe,QAAQ,kIAAkI,QAAQ;AAAA;AAAA;AAAA;AAAA,OAI3L,mBAAmB,QAAQ;AAAA,EAAM,WAAW;AAAA,IAAO;AAAA;AAAA;AAAA;AAAA,MAAA;AAAA,IAItD;AAAA,EAEH;AAEA,SAAO,CAAA;AACR;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stripIndent, source } from "common-tags";
|
|
2
2
|
var __freeze = Object.freeze;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(
|
|
4
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
|
|
5
5
|
var _a, _b;
|
|
6
6
|
const documentationRead = async (data, { options, helpers }) => {
|
|
7
7
|
if (data.kind === "PageSnippet") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentation-read.js","sources":["../../../src/hooks/documentation-read.ts"],"sourcesContent":["import { source, stripIndent } from \"common-tags\";\n\nimport type { DocumentationReadHook } from \"@slicemachine/plugin-kit\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const documentationRead: DocumentationReadHook<PluginOptions> = async (\n\tdata,\n\t{ options, helpers },\n) => {\n\tif (data.kind === \"PageSnippet\") {\n\t\tconst { model } = data.data;\n\t\tconst filePath = `${model.repeatable ? \"_uid\" : model.id}.vue`;\n\n\t\tlet fileContent: string;\n\n\t\tif (model.repeatable) {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic, params }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getByUID(\"${model.id}\", params.uid);\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t} else {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getSingle(\"${model.id}\");\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t}\n\n\t\tif (options.format) {\n\t\t\tfileContent = await helpers.format(\n\t\t\t\tfileContent,\n\t\t\t\thelpers.joinPathFromRoot(\"index.vue\"),\n\t\t\t\t{\n\t\t\t\t\tprettier: { parser: \"vue\" },\n\t\t\t\t\tincludeNewlineAtEnd: false,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: \"Options API\",\n\t\t\t\tcontent: source`\n\t\t\t\t\t## Create your ${model.label}'s page component\n\n\t\t\t\t\tAdd a new route by creating an \\`~/pages/${filePath}\\` file. (If the route should be nested in a child directory, you can create the file in a directory, like \\`~/pages/marketing/${filePath}\\`.)\n\n\t\t\t\t\tPaste in this code:\n\n\t\t\t\t\t${`~~~vue [~/pages/${filePath}]\\n${fileContent}\\n~~~`}\n\n\t\t\t\t\tMake sure all of your import paths are correct. See the [install guide](https://prismic.io/docs/nuxt-setup) for more information.\n\t\t\t\t`,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n"],"names":[],"mappings":";;;;AAAA,IAAA,IAAA;AAMO,MAAM,oBAA0D,OACtE,MACA,EAAE,SAAS,cACR;
|
|
1
|
+
{"version":3,"file":"documentation-read.js","sources":["../../../src/hooks/documentation-read.ts"],"sourcesContent":["import { source, stripIndent } from \"common-tags\";\n\nimport type { DocumentationReadHook } from \"@slicemachine/plugin-kit\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const documentationRead: DocumentationReadHook<PluginOptions> = async (\n\tdata,\n\t{ options, helpers },\n) => {\n\tif (data.kind === \"PageSnippet\") {\n\t\tconst { model } = data.data;\n\t\tconst filePath = `${model.repeatable ? \"_uid\" : model.id}.vue`;\n\n\t\tlet fileContent: string;\n\n\t\tif (model.repeatable) {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic, params }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getByUID(\"${model.id}\", params.uid);\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t} else {\n\t\t\tfileContent = stripIndent`\n\t\t\t\t<template>\n\t\t\t\t\t<SliceZone :slices=\"page.data.slices\" :components=\"components\" />\n\t\t\t\t</template>\n\n\t\t\t\t<script>\n\t\t\t\timport { components } from \"~/slices\";\n\n\t\t\t\texport default {\n\t\t\t\t\tasync asyncData({ $prismic }) {\n\t\t\t\t\t\tconst page = await $prismic.api.getSingle(\"${model.id}\");\n\n\t\t\t\t\t\treturn { page };\n\t\t\t\t\t},\n\t\t\t\t\tdata() {\n\t\t\t\t\t\treturn { components };\n\t\t\t\t\t},\n\t\t\t\t\thead() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: this.page.data.meta_title,\n\t\t\t\t\t\t\tmeta: [{\n\t\t\t\t\t\t\t\thid: \"description\",\n\t\t\t\t\t\t\t\tname: \"description\",\n\t\t\t\t\t\t\t\tcontent: this.page.data.meta_description,\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t</script>\n\t\t\t`;\n\t\t}\n\n\t\tif (options.format) {\n\t\t\tfileContent = await helpers.format(\n\t\t\t\tfileContent,\n\t\t\t\thelpers.joinPathFromRoot(\"index.vue\"),\n\t\t\t\t{\n\t\t\t\t\tprettier: { parser: \"vue\" },\n\t\t\t\t\tincludeNewlineAtEnd: false,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: \"Options API\",\n\t\t\t\tcontent: source`\n\t\t\t\t\t## Create your ${model.label}'s page component\n\n\t\t\t\t\tAdd a new route by creating an \\`~/pages/${filePath}\\` file. (If the route should be nested in a child directory, you can create the file in a directory, like \\`~/pages/marketing/${filePath}\\`.)\n\n\t\t\t\t\tPaste in this code:\n\n\t\t\t\t\t${`~~~vue [~/pages/${filePath}]\\n${fileContent}\\n~~~`}\n\n\t\t\t\t\tMake sure all of your import paths are correct. See the [install guide](https://prismic.io/docs/nuxt-setup) for more information.\n\t\t\t\t`,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n"],"names":[],"mappings":";;;;AAAA,IAAA,IAAA;AAMO,MAAM,oBAA0D,OACtE,MACA,EAAE,SAAS,cACR;AACH,MAAI,KAAK,SAAS,eAAe;AAChC,UAAM,EAAE,UAAU,KAAK;AACvB,UAAM,WAAW,GAAG,MAAM,aAAa,SAAS,MAAM,EAAE;AAExD,QAAI;AAEJ,QAAI,MAAM,YAAY;AACrB,oBAAc,YAAA,OAAA,KAAW,WAAA,CAAA,iSAU8B,8WAAA,CAAA,IAAR,MAAM,EAAA;AAAA,IAoBtD,OAAO;AACN,oBAAc,YAAA,OAAA,KAAW,WAAA,CAAA,0RAU+B,kWAAA,CAAA,IAAR,MAAM,EAAA;AAAA,IAoBvD;AAEA,QAAI,QAAQ,QAAQ;AACnB,oBAAc,MAAM,QAAQ,OAC3B,aACA,QAAQ,iBAAiB,WAAW,GACpC;AAAA,QACC,UAAU,EAAE,QAAQ,MAAA;AAAA,QACpB,qBAAqB;AAAA,MAAA,CACrB;AAAA,IAEH;AAEA,WAAO;AAAA,MACN;AAAA,QACC,OAAO;AAAA,QACP,SAAS;AAAA,sBACS,MAAM,KAAK;AAAA;AAAA,gDAEe,QAAQ,kIAAkI,QAAQ;AAAA;AAAA;AAAA;AAAA,OAI3L,mBAAmB,QAAQ;AAAA,EAAM,WAAW;AAAA,IAAO;AAAA;AAAA;AAAA;AAAA,MAAA;AAAA,IAItD;AAAA,EAEH;AAEA,SAAO,CAAA;AACR;"}
|
|
@@ -25,7 +25,7 @@ function _interopNamespaceDefault(e) {
|
|
|
25
25
|
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
26
26
|
var __freeze = Object.freeze;
|
|
27
27
|
var __defProp = Object.defineProperty;
|
|
28
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(
|
|
28
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
|
|
29
29
|
var _a;
|
|
30
30
|
const NUXT_PRISMIC = "@nuxtjs/prismic";
|
|
31
31
|
const installDependencies = async ({ installDependencies: installDependencies2 }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-init.cjs","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tcheckHasProjectFile,\n\twriteProjectFile,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\nimport { builders, loadFile, writeFile } from \"magicast\";\n\nimport { buildSrcPath } from \"../lib/buildSrcPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\tawait installDependencies({\n\t\tdependencies: {\n\t\t\t[NUXT_PRISMIC]: \"^1.4.2\",\n\t\t},\n\t\tdev: true,\n\t});\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigFilename = \"nuxt.config.js\";\n\n\tif (!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))) {\n\t\tnuxtConfigFilename = \"nuxt.config.ts\";\n\n\t\t// nuxt.config.* not found\n\t\tif (\n\t\t\t!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst nuxtConfigPath = helpers.joinPathFromRoot(nuxtConfigFilename);\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\n\tconst endpoint =\n\t\tproject.config.apiEndpoint ||\n\t\t`https://${project.config.repositoryName}.cdn.prismic.io/api/v2`;\n\n\tlet config;\n\ttry {\n\t\tconfig =\n\t\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t\t? mod.exports.default.$args[0]\n\t\t\t\t: mod.exports.default;\n\t} catch {\n\t\tconst errorMessage = `Failed to update ${path.basename(nuxtConfigPath)}`;\n\t\tconsole.error(errorMessage);\n\t\tconsole.warn(\n\t\t\t`Ensure that the following has been added to ${path.basename(\n\t\t\t\tnuxtConfigPath,\n\t\t\t)}.`,\n\t\t);\n\t\tconsole.warn(stripIndent`\n\t\t\t{\n\t\t\t\tbuildModules: [\"@nuxtjs/prismic\"],\n\t\t\t\tprismic: {\n\t\t\t\t\tendpoint: \"${endpoint}\",\n\t\t\t\t\tmodern: true\n\t\t\t\t}\n\t\t\t}\n\t\t`);\n\n\t\tthrow errorMessage;\n\t}\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = !![\n\t\t...(config.modules || []),\n\t\t...(config.buildModules || []),\n\t].find((registration: string | [string, unknown]) => {\n\t\tif (typeof registration === \"string\") {\n\t\t\treturn registration === NUXT_PRISMIC;\n\t\t} else if (Array.isArray(registration)) {\n\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t}\n\n\t\treturn false;\n\t});\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.buildModules ||= [];\n\t\tconfig.buildModules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tif (!hasInlinedConfiguration) {\n\t\t// Import Slice Machine configuration\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"apiEndpoint\",\n\t\t});\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"repositoryName\",\n\t\t});\n\n\t\t// Add inline configuration\n\t\tif (config.prismic) {\n\t\t\tconfig.prismic.endpoint = builders.raw(\"apiEndpoint || repositoryName\");\n\t\t} else {\n\t\t\tconfig.prismic = {\n\t\t\t\tendpoint: builders.raw(\"apiEndpoint || repositoryName\"),\n\t\t\t\tmodern: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tawait writeFile(mod, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst filename = await buildSrcPath({\n\t\tfilename: path.join(\"pages\", \"slice-simulator.vue\"),\n\t\thelpers,\n\t});\n\n\tif (await checkHasProjectFile({ filename, helpers })) {\n\t\treturn;\n\t}\n\n\tconst contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator v-slot=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt2/dist/simulator.cjs\";\n\t\timport { components } from \"~/slices\";\n\n\t\texport default {\n\t\t\tcomponents: {\n\t\t\t\tSliceSimulator,\n\t\t\t},\n\t\t\tdata () {\n\t\t\t\treturn { components };\n\t\t\t},\n\t\t};\n\t\t</script>\n\t`;\n\n\tawait writeProjectFile({\n\t\tfilename,\n\t\tcontents,\n\t\tformat: options.format,\n\t\thelpers,\n\t});\n};\n\nconst modifySliceMachineConfig = async ({\n\thelpers,\n\toptions,\n\tactions,\n}: SliceMachineContext<PluginOptions>) => {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers,\n\t});\n\tconst project = await helpers.getProject();\n\n\t// Add Slice Simulator URL.\n\tproject.config.localSliceSimulatorURL ||=\n\t\t\"http://localhost:3000/slice-simulator\";\n\n\t// Nest the default Slice Library in the src directory if it exists and\n\t// is empty.\n\tif (\n\t\thasSrcDirectory &&\n\t\tproject.config.libraries &&\n\t\tJSON.stringify(project.config.libraries) === JSON.stringify([\"./slices\"])\n\t) {\n\t\tconst sliceLibrary = await actions.readSliceLibrary({\n\t\t\tlibraryID: project.config.libraries[0],\n\t\t});\n\n\t\tif (sliceLibrary.sliceIDs.length < 1) {\n\t\t\tproject.config.libraries = [\"./src/slices\"];\n\t\t}\n\t}\n\n\tawait helpers.updateSliceMachineConfig(project.config, {\n\t\tformat: options.format,\n\t});\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tinstallDependencies({ installDependencies: _installDependencies }),\n\t\t\tconfigurePrismicModule(context),\n\t\t\tcreateSliceSimulatorPage(context),\n\t\t\tmodifySliceMachineConfig(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies","checkHasProjectFile","loadFile","path","stripIndent","builders","writeFile","buildSrcPath","writeProjectFile","_a","rejectIfNecessary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AAkBA,MAAM,eAAe;AAMrB,MAAM,sBAAsB,OAAO,EAClC,qBAAAA,2BAC6B;AAC7B,QAAMA,qBAAoB;AAAA,IACzB,cAAc;AAAA,MACb,CAAC,YAAY,GAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"project-init.cjs","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tcheckHasProjectFile,\n\twriteProjectFile,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\nimport { builders, loadFile, writeFile } from \"magicast\";\n\nimport { buildSrcPath } from \"../lib/buildSrcPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\tawait installDependencies({\n\t\tdependencies: {\n\t\t\t[NUXT_PRISMIC]: \"^1.4.2\",\n\t\t},\n\t\tdev: true,\n\t});\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigFilename = \"nuxt.config.js\";\n\n\tif (!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))) {\n\t\tnuxtConfigFilename = \"nuxt.config.ts\";\n\n\t\t// nuxt.config.* not found\n\t\tif (\n\t\t\t!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst nuxtConfigPath = helpers.joinPathFromRoot(nuxtConfigFilename);\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\n\tconst endpoint =\n\t\tproject.config.apiEndpoint ||\n\t\t`https://${project.config.repositoryName}.cdn.prismic.io/api/v2`;\n\n\tlet config;\n\ttry {\n\t\tconfig =\n\t\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t\t? mod.exports.default.$args[0]\n\t\t\t\t: mod.exports.default;\n\t} catch {\n\t\tconst errorMessage = `Failed to update ${path.basename(nuxtConfigPath)}`;\n\t\tconsole.error(errorMessage);\n\t\tconsole.warn(\n\t\t\t`Ensure that the following has been added to ${path.basename(\n\t\t\t\tnuxtConfigPath,\n\t\t\t)}.`,\n\t\t);\n\t\tconsole.warn(stripIndent`\n\t\t\t{\n\t\t\t\tbuildModules: [\"@nuxtjs/prismic\"],\n\t\t\t\tprismic: {\n\t\t\t\t\tendpoint: \"${endpoint}\",\n\t\t\t\t\tmodern: true\n\t\t\t\t}\n\t\t\t}\n\t\t`);\n\n\t\tthrow errorMessage;\n\t}\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = !![\n\t\t...(config.modules || []),\n\t\t...(config.buildModules || []),\n\t].find((registration: string | [string, unknown]) => {\n\t\tif (typeof registration === \"string\") {\n\t\t\treturn registration === NUXT_PRISMIC;\n\t\t} else if (Array.isArray(registration)) {\n\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t}\n\n\t\treturn false;\n\t});\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.buildModules ||= [];\n\t\tconfig.buildModules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tif (!hasInlinedConfiguration) {\n\t\t// Import Slice Machine configuration\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"apiEndpoint\",\n\t\t});\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"repositoryName\",\n\t\t});\n\n\t\t// Add inline configuration\n\t\tif (config.prismic) {\n\t\t\tconfig.prismic.endpoint = builders.raw(\"apiEndpoint || repositoryName\");\n\t\t} else {\n\t\t\tconfig.prismic = {\n\t\t\t\tendpoint: builders.raw(\"apiEndpoint || repositoryName\"),\n\t\t\t\tmodern: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tawait writeFile(mod, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst filename = await buildSrcPath({\n\t\tfilename: path.join(\"pages\", \"slice-simulator.vue\"),\n\t\thelpers,\n\t});\n\n\tif (await checkHasProjectFile({ filename, helpers })) {\n\t\treturn;\n\t}\n\n\tconst contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator v-slot=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt2/dist/simulator.cjs\";\n\t\timport { components } from \"~/slices\";\n\n\t\texport default {\n\t\t\tcomponents: {\n\t\t\t\tSliceSimulator,\n\t\t\t},\n\t\t\tdata () {\n\t\t\t\treturn { components };\n\t\t\t},\n\t\t};\n\t\t</script>\n\t`;\n\n\tawait writeProjectFile({\n\t\tfilename,\n\t\tcontents,\n\t\tformat: options.format,\n\t\thelpers,\n\t});\n};\n\nconst modifySliceMachineConfig = async ({\n\thelpers,\n\toptions,\n\tactions,\n}: SliceMachineContext<PluginOptions>) => {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers,\n\t});\n\tconst project = await helpers.getProject();\n\n\t// Add Slice Simulator URL.\n\tproject.config.localSliceSimulatorURL ||=\n\t\t\"http://localhost:3000/slice-simulator\";\n\n\t// Nest the default Slice Library in the src directory if it exists and\n\t// is empty.\n\tif (\n\t\thasSrcDirectory &&\n\t\tproject.config.libraries &&\n\t\tJSON.stringify(project.config.libraries) === JSON.stringify([\"./slices\"])\n\t) {\n\t\tconst sliceLibrary = await actions.readSliceLibrary({\n\t\t\tlibraryID: project.config.libraries[0],\n\t\t});\n\n\t\tif (sliceLibrary.sliceIDs.length < 1) {\n\t\t\tproject.config.libraries = [\"./src/slices\"];\n\t\t}\n\t}\n\n\tawait helpers.updateSliceMachineConfig(project.config, {\n\t\tformat: options.format,\n\t});\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tinstallDependencies({ installDependencies: _installDependencies }),\n\t\t\tconfigurePrismicModule(context),\n\t\t\tcreateSliceSimulatorPage(context),\n\t\t\tmodifySliceMachineConfig(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies","checkHasProjectFile","loadFile","path","stripIndent","builders","writeFile","buildSrcPath","writeProjectFile","_a","rejectIfNecessary"],"mappings":"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"}
|
|
@@ -6,7 +6,7 @@ import { buildSrcPath } from "../lib/buildSrcPath.js";
|
|
|
6
6
|
import { rejectIfNecessary } from "../lib/rejectIfNecessary.js";
|
|
7
7
|
var __freeze = Object.freeze;
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
9
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(
|
|
9
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
|
|
10
10
|
var _a;
|
|
11
11
|
const NUXT_PRISMIC = "@nuxtjs/prismic";
|
|
12
12
|
const installDependencies = async ({ installDependencies: installDependencies2 }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-init.js","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tcheckHasProjectFile,\n\twriteProjectFile,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\nimport { builders, loadFile, writeFile } from \"magicast\";\n\nimport { buildSrcPath } from \"../lib/buildSrcPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\tawait installDependencies({\n\t\tdependencies: {\n\t\t\t[NUXT_PRISMIC]: \"^1.4.2\",\n\t\t},\n\t\tdev: true,\n\t});\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigFilename = \"nuxt.config.js\";\n\n\tif (!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))) {\n\t\tnuxtConfigFilename = \"nuxt.config.ts\";\n\n\t\t// nuxt.config.* not found\n\t\tif (\n\t\t\t!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst nuxtConfigPath = helpers.joinPathFromRoot(nuxtConfigFilename);\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\n\tconst endpoint =\n\t\tproject.config.apiEndpoint ||\n\t\t`https://${project.config.repositoryName}.cdn.prismic.io/api/v2`;\n\n\tlet config;\n\ttry {\n\t\tconfig =\n\t\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t\t? mod.exports.default.$args[0]\n\t\t\t\t: mod.exports.default;\n\t} catch {\n\t\tconst errorMessage = `Failed to update ${path.basename(nuxtConfigPath)}`;\n\t\tconsole.error(errorMessage);\n\t\tconsole.warn(\n\t\t\t`Ensure that the following has been added to ${path.basename(\n\t\t\t\tnuxtConfigPath,\n\t\t\t)}.`,\n\t\t);\n\t\tconsole.warn(stripIndent`\n\t\t\t{\n\t\t\t\tbuildModules: [\"@nuxtjs/prismic\"],\n\t\t\t\tprismic: {\n\t\t\t\t\tendpoint: \"${endpoint}\",\n\t\t\t\t\tmodern: true\n\t\t\t\t}\n\t\t\t}\n\t\t`);\n\n\t\tthrow errorMessage;\n\t}\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = !![\n\t\t...(config.modules || []),\n\t\t...(config.buildModules || []),\n\t].find((registration: string | [string, unknown]) => {\n\t\tif (typeof registration === \"string\") {\n\t\t\treturn registration === NUXT_PRISMIC;\n\t\t} else if (Array.isArray(registration)) {\n\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t}\n\n\t\treturn false;\n\t});\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.buildModules ||= [];\n\t\tconfig.buildModules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tif (!hasInlinedConfiguration) {\n\t\t// Import Slice Machine configuration\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"apiEndpoint\",\n\t\t});\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"repositoryName\",\n\t\t});\n\n\t\t// Add inline configuration\n\t\tif (config.prismic) {\n\t\t\tconfig.prismic.endpoint = builders.raw(\"apiEndpoint || repositoryName\");\n\t\t} else {\n\t\t\tconfig.prismic = {\n\t\t\t\tendpoint: builders.raw(\"apiEndpoint || repositoryName\"),\n\t\t\t\tmodern: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tawait writeFile(mod, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst filename = await buildSrcPath({\n\t\tfilename: path.join(\"pages\", \"slice-simulator.vue\"),\n\t\thelpers,\n\t});\n\n\tif (await checkHasProjectFile({ filename, helpers })) {\n\t\treturn;\n\t}\n\n\tconst contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator v-slot=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt2/dist/simulator.cjs\";\n\t\timport { components } from \"~/slices\";\n\n\t\texport default {\n\t\t\tcomponents: {\n\t\t\t\tSliceSimulator,\n\t\t\t},\n\t\t\tdata () {\n\t\t\t\treturn { components };\n\t\t\t},\n\t\t};\n\t\t</script>\n\t`;\n\n\tawait writeProjectFile({\n\t\tfilename,\n\t\tcontents,\n\t\tformat: options.format,\n\t\thelpers,\n\t});\n};\n\nconst modifySliceMachineConfig = async ({\n\thelpers,\n\toptions,\n\tactions,\n}: SliceMachineContext<PluginOptions>) => {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers,\n\t});\n\tconst project = await helpers.getProject();\n\n\t// Add Slice Simulator URL.\n\tproject.config.localSliceSimulatorURL ||=\n\t\t\"http://localhost:3000/slice-simulator\";\n\n\t// Nest the default Slice Library in the src directory if it exists and\n\t// is empty.\n\tif (\n\t\thasSrcDirectory &&\n\t\tproject.config.libraries &&\n\t\tJSON.stringify(project.config.libraries) === JSON.stringify([\"./slices\"])\n\t) {\n\t\tconst sliceLibrary = await actions.readSliceLibrary({\n\t\t\tlibraryID: project.config.libraries[0],\n\t\t});\n\n\t\tif (sliceLibrary.sliceIDs.length < 1) {\n\t\t\tproject.config.libraries = [\"./src/slices\"];\n\t\t}\n\t}\n\n\tawait helpers.updateSliceMachineConfig(project.config, {\n\t\tformat: options.format,\n\t});\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tinstallDependencies({ installDependencies: _installDependencies }),\n\t\t\tconfigurePrismicModule(context),\n\t\t\tcreateSliceSimulatorPage(context),\n\t\t\tmodifySliceMachineConfig(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies","_a"],"mappings":";;;;;;;;;AAAA,IAAA;AAkBA,MAAM,eAAe;AAMrB,MAAM,sBAAsB,OAAO,EAClC,qBAAAA,2BAC6B;AAC7B,QAAMA,qBAAoB;AAAA,IACzB,cAAc;AAAA,MACb,CAAC,YAAY,GAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"project-init.js","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tcheckHasProjectFile,\n\twriteProjectFile,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\nimport { builders, loadFile, writeFile } from \"magicast\";\n\nimport { buildSrcPath } from \"../lib/buildSrcPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\tawait installDependencies({\n\t\tdependencies: {\n\t\t\t[NUXT_PRISMIC]: \"^1.4.2\",\n\t\t},\n\t\tdev: true,\n\t});\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigFilename = \"nuxt.config.js\";\n\n\tif (!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))) {\n\t\tnuxtConfigFilename = \"nuxt.config.ts\";\n\n\t\t// nuxt.config.* not found\n\t\tif (\n\t\t\t!(await checkHasProjectFile({ filename: nuxtConfigFilename, helpers }))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst nuxtConfigPath = helpers.joinPathFromRoot(nuxtConfigFilename);\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\n\tconst endpoint =\n\t\tproject.config.apiEndpoint ||\n\t\t`https://${project.config.repositoryName}.cdn.prismic.io/api/v2`;\n\n\tlet config;\n\ttry {\n\t\tconfig =\n\t\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t\t? mod.exports.default.$args[0]\n\t\t\t\t: mod.exports.default;\n\t} catch {\n\t\tconst errorMessage = `Failed to update ${path.basename(nuxtConfigPath)}`;\n\t\tconsole.error(errorMessage);\n\t\tconsole.warn(\n\t\t\t`Ensure that the following has been added to ${path.basename(\n\t\t\t\tnuxtConfigPath,\n\t\t\t)}.`,\n\t\t);\n\t\tconsole.warn(stripIndent`\n\t\t\t{\n\t\t\t\tbuildModules: [\"@nuxtjs/prismic\"],\n\t\t\t\tprismic: {\n\t\t\t\t\tendpoint: \"${endpoint}\",\n\t\t\t\t\tmodern: true\n\t\t\t\t}\n\t\t\t}\n\t\t`);\n\n\t\tthrow errorMessage;\n\t}\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = !![\n\t\t...(config.modules || []),\n\t\t...(config.buildModules || []),\n\t].find((registration: string | [string, unknown]) => {\n\t\tif (typeof registration === \"string\") {\n\t\t\treturn registration === NUXT_PRISMIC;\n\t\t} else if (Array.isArray(registration)) {\n\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t}\n\n\t\treturn false;\n\t});\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.buildModules ||= [];\n\t\tconfig.buildModules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tif (!hasInlinedConfiguration) {\n\t\t// Import Slice Machine configuration\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"apiEndpoint\",\n\t\t});\n\t\tmod.imports.$add({\n\t\t\tfrom: \"./slicemachine.config.json\",\n\t\t\timported: \"repositoryName\",\n\t\t});\n\n\t\t// Add inline configuration\n\t\tif (config.prismic) {\n\t\t\tconfig.prismic.endpoint = builders.raw(\"apiEndpoint || repositoryName\");\n\t\t} else {\n\t\t\tconfig.prismic = {\n\t\t\t\tendpoint: builders.raw(\"apiEndpoint || repositoryName\"),\n\t\t\t\tmodern: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tawait writeFile(mod, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst filename = await buildSrcPath({\n\t\tfilename: path.join(\"pages\", \"slice-simulator.vue\"),\n\t\thelpers,\n\t});\n\n\tif (await checkHasProjectFile({ filename, helpers })) {\n\t\treturn;\n\t}\n\n\tconst contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator v-slot=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt2/dist/simulator.cjs\";\n\t\timport { components } from \"~/slices\";\n\n\t\texport default {\n\t\t\tcomponents: {\n\t\t\t\tSliceSimulator,\n\t\t\t},\n\t\t\tdata () {\n\t\t\t\treturn { components };\n\t\t\t},\n\t\t};\n\t\t</script>\n\t`;\n\n\tawait writeProjectFile({\n\t\tfilename,\n\t\tcontents,\n\t\tformat: options.format,\n\t\thelpers,\n\t});\n};\n\nconst modifySliceMachineConfig = async ({\n\thelpers,\n\toptions,\n\tactions,\n}: SliceMachineContext<PluginOptions>) => {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers,\n\t});\n\tconst project = await helpers.getProject();\n\n\t// Add Slice Simulator URL.\n\tproject.config.localSliceSimulatorURL ||=\n\t\t\"http://localhost:3000/slice-simulator\";\n\n\t// Nest the default Slice Library in the src directory if it exists and\n\t// is empty.\n\tif (\n\t\thasSrcDirectory &&\n\t\tproject.config.libraries &&\n\t\tJSON.stringify(project.config.libraries) === JSON.stringify([\"./slices\"])\n\t) {\n\t\tconst sliceLibrary = await actions.readSliceLibrary({\n\t\t\tlibraryID: project.config.libraries[0],\n\t\t});\n\n\t\tif (sliceLibrary.sliceIDs.length < 1) {\n\t\t\tproject.config.libraries = [\"./src/slices\"];\n\t\t}\n\t}\n\n\tawait helpers.updateSliceMachineConfig(project.config, {\n\t\tformat: options.format,\n\t});\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tinstallDependencies({ installDependencies: _installDependencies }),\n\t\t\tconfigurePrismicModule(context),\n\t\t\tcreateSliceSimulatorPage(context),\n\t\t\tmodifySliceMachineConfig(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies","_a"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice-create.cjs","sources":["../../../src/hooks/slice-create.ts"],"sourcesContent":["import type {\n\tSliceCreateHook,\n\tSliceCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tupsertGlobalTypeScriptTypes,\n\twriteSliceFile,\n\twriteSliceModel,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\n\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype CreateComponentFileArgs = {\n\tdata: SliceCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createComponentFile = async ({\n\tdata,\n\thelpers,\n\tactions,\n\toptions,\n}: CreateComponentFileArgs) => {\n\tconst contents =\n\t\tdata.componentContents ??\n\t\tstripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for ${data.model.id} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script>\n\t\t\timport { getSliceComponentProps } from \"@prismicio/vue/components\";\n\n\t\t\texport default {\n\t\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\t\tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n\t\t\t};\n\t\t\t</script>\n\t\t`;\n\n\tawait writeSliceFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\tfilename: \"index.vue\",\n\t\tcontents,\n\t\tformat: options.format,\n\t\tactions,\n\t\thelpers,\n\t});\n};\n\nexport const sliceCreate: SliceCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\twriteSliceModel({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\tmodel: data.model,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t}),\n\t\t\tcreateComponentFile({ data, ...context }),\n\t\t]),\n\t);\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertSliceLibraryIndexFile({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\t...context,\n\t\t\t}),\n\t\t\tupsertGlobalTypeScriptTypes({\n\t\t\t\tfilename: context.options.generatedTypesFilePath,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t\tactions: context.actions,\n\t\t\t}),\n\t\t]),\n\t);\n};\n"],"names":["stripIndent","writeSliceFile","rejectIfNecessary","writeSliceModel","upsertSliceLibraryIndexFile","upsertGlobalTypeScriptTypes"],"mappings":";;;;;;;;;AAKA,IAAA;AAgBA,MAAM,sBAAsB,OAAO,EAClC,MACA,SACA,SACA,cAC6B;
|
|
1
|
+
{"version":3,"file":"slice-create.cjs","sources":["../../../src/hooks/slice-create.ts"],"sourcesContent":["import type {\n\tSliceCreateHook,\n\tSliceCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tupsertGlobalTypeScriptTypes,\n\twriteSliceFile,\n\twriteSliceModel,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\n\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype CreateComponentFileArgs = {\n\tdata: SliceCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createComponentFile = async ({\n\tdata,\n\thelpers,\n\tactions,\n\toptions,\n}: CreateComponentFileArgs) => {\n\tconst contents =\n\t\tdata.componentContents ??\n\t\tstripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for ${data.model.id} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script>\n\t\t\timport { getSliceComponentProps } from \"@prismicio/vue/components\";\n\n\t\t\texport default {\n\t\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\t\tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n\t\t\t};\n\t\t\t</script>\n\t\t`;\n\n\tawait writeSliceFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\tfilename: \"index.vue\",\n\t\tcontents,\n\t\tformat: options.format,\n\t\tactions,\n\t\thelpers,\n\t});\n};\n\nexport const sliceCreate: SliceCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\twriteSliceModel({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\tmodel: data.model,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t}),\n\t\t\tcreateComponentFile({ data, ...context }),\n\t\t]),\n\t);\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertSliceLibraryIndexFile({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\t...context,\n\t\t\t}),\n\t\t\tupsertGlobalTypeScriptTypes({\n\t\t\t\tfilename: context.options.generatedTypesFilePath,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t\tactions: context.actions,\n\t\t\t}),\n\t\t]),\n\t);\n};\n"],"names":["stripIndent","writeSliceFile","rejectIfNecessary","writeSliceModel","upsertSliceLibraryIndexFile","upsertGlobalTypeScriptTypes"],"mappings":";;;;;;;;;AAKA,IAAA;AAgBA,MAAM,sBAAsB,OAAO,EAClC,MACA,SACA,SACA,cAC6B;AAC7B,QAAM,WACL,KAAK,qBACLA,WAAAA,YAAA,OAAA,KAAW,6KAMiC,mbAAA,GANjC,CAAA,iKAMiC,ubAAA,CAAA,IAAb,KAAK,MAAM,EAAA;AAe3C,QAAMC,kBAAe;AAAA,IACpB,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,UAAU;AAAA,IACV;AAAA,IACA,QAAQ,QAAQ;AAAA,IAChB;AAAA,IACA;AAAA,EAAA,CACA;AACF;AAEO,MAAM,cAA8C,OAC1D,MACA,YACG;AACHC,sCACC,MAAM,QAAQ,WAAW;AAAA,IACxBC,mBAAgB;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,OAAO,KAAK;AAAA,MACZ,QAAQ,QAAQ,QAAQ;AAAA,MACxB,SAAS,QAAQ;AAAA,IAAA,CACjB;AAAA,IACD,oBAAoB,EAAE,MAAM,GAAG,SAAS;AAAA,EAAA,CACxC,CAAC;AAGHD,sCACC,MAAM,QAAQ,WAAW;AAAA,IACxBE,wDAA4B;AAAA,MAC3B,WAAW,KAAK;AAAA,MAChB,GAAG;AAAA,IAAA,CACH;AAAA,IACDC,+BAA4B;AAAA,MAC3B,UAAU,QAAQ,QAAQ;AAAA,MAC1B,QAAQ,QAAQ,QAAQ;AAAA,MACxB,SAAS,QAAQ;AAAA,MACjB,SAAS,QAAQ;AAAA,IAAA,CACjB;AAAA,EAAA,CACD,CAAC;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice-create.js","sources":["../../../src/hooks/slice-create.ts"],"sourcesContent":["import type {\n\tSliceCreateHook,\n\tSliceCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tupsertGlobalTypeScriptTypes,\n\twriteSliceFile,\n\twriteSliceModel,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\n\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype CreateComponentFileArgs = {\n\tdata: SliceCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createComponentFile = async ({\n\tdata,\n\thelpers,\n\tactions,\n\toptions,\n}: CreateComponentFileArgs) => {\n\tconst contents =\n\t\tdata.componentContents ??\n\t\tstripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for ${data.model.id} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script>\n\t\t\timport { getSliceComponentProps } from \"@prismicio/vue/components\";\n\n\t\t\texport default {\n\t\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\t\tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n\t\t\t};\n\t\t\t</script>\n\t\t`;\n\n\tawait writeSliceFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\tfilename: \"index.vue\",\n\t\tcontents,\n\t\tformat: options.format,\n\t\tactions,\n\t\thelpers,\n\t});\n};\n\nexport const sliceCreate: SliceCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\twriteSliceModel({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\tmodel: data.model,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t}),\n\t\t\tcreateComponentFile({ data, ...context }),\n\t\t]),\n\t);\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertSliceLibraryIndexFile({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\t...context,\n\t\t\t}),\n\t\t\tupsertGlobalTypeScriptTypes({\n\t\t\t\tfilename: context.options.generatedTypesFilePath,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t\tactions: context.actions,\n\t\t\t}),\n\t\t]),\n\t);\n};\n"],"names":[],"mappings":";;;;;;;AAKA,IAAA;AAgBA,MAAM,sBAAsB,OAAO,EAClC,MACA,SACA,SACA,cAC6B;
|
|
1
|
+
{"version":3,"file":"slice-create.js","sources":["../../../src/hooks/slice-create.ts"],"sourcesContent":["import type {\n\tSliceCreateHook,\n\tSliceCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport {\n\tupsertGlobalTypeScriptTypes,\n\twriteSliceFile,\n\twriteSliceModel,\n} from \"@slicemachine/plugin-kit/fs\";\nimport { stripIndent } from \"common-tags\";\n\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype CreateComponentFileArgs = {\n\tdata: SliceCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createComponentFile = async ({\n\tdata,\n\thelpers,\n\tactions,\n\toptions,\n}: CreateComponentFileArgs) => {\n\tconst contents =\n\t\tdata.componentContents ??\n\t\tstripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for ${data.model.id} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script>\n\t\t\timport { getSliceComponentProps } from \"@prismicio/vue/components\";\n\n\t\t\texport default {\n\t\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\t\tprops: getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n\t\t\t};\n\t\t\t</script>\n\t\t`;\n\n\tawait writeSliceFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\tfilename: \"index.vue\",\n\t\tcontents,\n\t\tformat: options.format,\n\t\tactions,\n\t\thelpers,\n\t});\n};\n\nexport const sliceCreate: SliceCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\twriteSliceModel({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\tmodel: data.model,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t}),\n\t\t\tcreateComponentFile({ data, ...context }),\n\t\t]),\n\t);\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertSliceLibraryIndexFile({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\t...context,\n\t\t\t}),\n\t\t\tupsertGlobalTypeScriptTypes({\n\t\t\t\tfilename: context.options.generatedTypesFilePath,\n\t\t\t\tformat: context.options.format,\n\t\t\t\thelpers: context.helpers,\n\t\t\t\tactions: context.actions,\n\t\t\t}),\n\t\t]),\n\t);\n};\n"],"names":[],"mappings":";;;;;;;AAKA,IAAA;AAgBA,MAAM,sBAAsB,OAAO,EAClC,MACA,SACA,SACA,cAC6B;AAC7B,QAAM,WACL,KAAK,qBACL,YAAA,OAAA,KAAW,6KAMiC,mbAAA,GANjC,CAAA,iKAMiC,ubAAA,CAAA,IAAb,KAAK,MAAM,EAAA;AAe3C,QAAM,eAAe;AAAA,IACpB,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,UAAU;AAAA,IACV;AAAA,IACA,QAAQ,QAAQ;AAAA,IAChB;AAAA,IACA;AAAA,EAAA,CACA;AACF;AAEO,MAAM,cAA8C,OAC1D,MACA,YACG;AACH,oBACC,MAAM,QAAQ,WAAW;AAAA,IACxB,gBAAgB;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,OAAO,KAAK;AAAA,MACZ,QAAQ,QAAQ,QAAQ;AAAA,MACxB,SAAS,QAAQ;AAAA,IAAA,CACjB;AAAA,IACD,oBAAoB,EAAE,MAAM,GAAG,SAAS;AAAA,EAAA,CACxC,CAAC;AAGH,oBACC,MAAM,QAAQ,WAAW;AAAA,IACxB,4BAA4B;AAAA,MAC3B,WAAW,KAAK;AAAA,MAChB,GAAG;AAAA,IAAA,CACH;AAAA,IACD,4BAA4B;AAAA,MAC3B,UAAU,QAAQ,QAAQ;AAAA,MAC1B,QAAQ,QAAQ,QAAQ;AAAA,MACxB,SAAS,QAAQ;AAAA,MACjB,SAAS,QAAQ;AAAA,IAAA,CACjB;AAAA,EAAA,CACD,CAAC;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-read.cjs","sources":["../../../src/hooks/snippet-read.ts"],"sourcesContent":["import type {\n\tSliceMachineHelpers,\n\tSnippetReadHook,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst dotPath = (segments: string[]): string => {\n\treturn segments.join(\".\");\n};\n\nconst format = async (input: string, helpers: SliceMachineHelpers) => {\n\tconst formattedInput = await helpers.format(input, undefined, {\n\t\tincludeNewlineAtEnd: false,\n\t\tprettier: {\n\t\t\tparser: \"vue\",\n\t\t},\n\t});\n\n\treturn formattedInput.endsWith(\";\")\n\t\t? formattedInput.substring(0, formattedInput.length - 1)\n\t\t: formattedInput;\n};\n\nexport const snippetRead: SnippetReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst { fieldPath, itemName } = data;\n\n\tconst label = \"Vue\";\n\n\tswitch (data.model.type) {\n\t\tcase \"StructuredText\": {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (rich)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicRichText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (plain)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst repeat = data.model.config?.repeat ?? false;\n\t\t\tconst allowText = data.model.config?.allowText ?? false;\n\n\t\t\tconst allowVariants = Boolean(data.model.config?.variants);\n\t\t\tconst variant = (path: string) =>\n\t\t\t\tallowVariants ? ` :class=\"${path}.variant\"` : \"\";\n\n\t\t\tconst path = dotPath(fieldPath);\n\n\t\t\tlet codeText;\n\t\t\tif (!repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)}>Link</PrismicLink>\n\t\t\t\t`;\n\t\t\t} else if (!repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)} />\n\t\t\t\t`;\n\t\t\t} else if (repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")}>Link</PrismicLink>\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else if (repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")} />\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Invalid configuration.\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(codeText, helpers),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicImage :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicTable :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicEmbed :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<template v-for=\"${itemName} in ${dotPath(fieldPath)}\">\n\t\t\t\t\t\t\t{{ ${itemName} }}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst code = await format(\n\t\t\t\tstripIndent`\n\t\t\t\t\t<SliceZone\n\t\t\t\t\t\t:slices=\"${dotPath(fieldPath)}\"\n\t\t\t\t\t\t:components=\"components\"\n\t\t\t\t\t/>\n\t\t\t\t`,\n\t\t\t\thelpers,\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode,\n\t\t\t};\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t{{${dotPath(fieldPath)}}}\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n};\n"],"names":["stripIndent","path"],"mappings":";;;AAQA,MAAM,UAAU,CAAC,aAA8B;
|
|
1
|
+
{"version":3,"file":"snippet-read.cjs","sources":["../../../src/hooks/snippet-read.ts"],"sourcesContent":["import type {\n\tSliceMachineHelpers,\n\tSnippetReadHook,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst dotPath = (segments: string[]): string => {\n\treturn segments.join(\".\");\n};\n\nconst format = async (input: string, helpers: SliceMachineHelpers) => {\n\tconst formattedInput = await helpers.format(input, undefined, {\n\t\tincludeNewlineAtEnd: false,\n\t\tprettier: {\n\t\t\tparser: \"vue\",\n\t\t},\n\t});\n\n\treturn formattedInput.endsWith(\";\")\n\t\t? formattedInput.substring(0, formattedInput.length - 1)\n\t\t: formattedInput;\n};\n\nexport const snippetRead: SnippetReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst { fieldPath, itemName } = data;\n\n\tconst label = \"Vue\";\n\n\tswitch (data.model.type) {\n\t\tcase \"StructuredText\": {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (rich)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicRichText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (plain)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst repeat = data.model.config?.repeat ?? false;\n\t\t\tconst allowText = data.model.config?.allowText ?? false;\n\n\t\t\tconst allowVariants = Boolean(data.model.config?.variants);\n\t\t\tconst variant = (path: string) =>\n\t\t\t\tallowVariants ? ` :class=\"${path}.variant\"` : \"\";\n\n\t\t\tconst path = dotPath(fieldPath);\n\n\t\t\tlet codeText;\n\t\t\tif (!repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)}>Link</PrismicLink>\n\t\t\t\t`;\n\t\t\t} else if (!repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)} />\n\t\t\t\t`;\n\t\t\t} else if (repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")}>Link</PrismicLink>\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else if (repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")} />\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Invalid configuration.\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(codeText, helpers),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicImage :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicTable :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicEmbed :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<template v-for=\"${itemName} in ${dotPath(fieldPath)}\">\n\t\t\t\t\t\t\t{{ ${itemName} }}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst code = await format(\n\t\t\t\tstripIndent`\n\t\t\t\t\t<SliceZone\n\t\t\t\t\t\t:slices=\"${dotPath(fieldPath)}\"\n\t\t\t\t\t\t:components=\"components\"\n\t\t\t\t\t/>\n\t\t\t\t`,\n\t\t\t\thelpers,\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode,\n\t\t\t};\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t{{${dotPath(fieldPath)}}}\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n};\n"],"names":["stripIndent","path"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-read.js","sources":["../../../src/hooks/snippet-read.ts"],"sourcesContent":["import type {\n\tSliceMachineHelpers,\n\tSnippetReadHook,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst dotPath = (segments: string[]): string => {\n\treturn segments.join(\".\");\n};\n\nconst format = async (input: string, helpers: SliceMachineHelpers) => {\n\tconst formattedInput = await helpers.format(input, undefined, {\n\t\tincludeNewlineAtEnd: false,\n\t\tprettier: {\n\t\t\tparser: \"vue\",\n\t\t},\n\t});\n\n\treturn formattedInput.endsWith(\";\")\n\t\t? formattedInput.substring(0, formattedInput.length - 1)\n\t\t: formattedInput;\n};\n\nexport const snippetRead: SnippetReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst { fieldPath, itemName } = data;\n\n\tconst label = \"Vue\";\n\n\tswitch (data.model.type) {\n\t\tcase \"StructuredText\": {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (rich)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicRichText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (plain)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst repeat = data.model.config?.repeat ?? false;\n\t\t\tconst allowText = data.model.config?.allowText ?? false;\n\n\t\t\tconst allowVariants = Boolean(data.model.config?.variants);\n\t\t\tconst variant = (path: string) =>\n\t\t\t\tallowVariants ? ` :class=\"${path}.variant\"` : \"\";\n\n\t\t\tconst path = dotPath(fieldPath);\n\n\t\t\tlet codeText;\n\t\t\tif (!repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)}>Link</PrismicLink>\n\t\t\t\t`;\n\t\t\t} else if (!repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)} />\n\t\t\t\t`;\n\t\t\t} else if (repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")}>Link</PrismicLink>\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else if (repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")} />\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Invalid configuration.\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(codeText, helpers),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicImage :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicTable :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicEmbed :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<template v-for=\"${itemName} in ${dotPath(fieldPath)}\">\n\t\t\t\t\t\t\t{{ ${itemName} }}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst code = await format(\n\t\t\t\tstripIndent`\n\t\t\t\t\t<SliceZone\n\t\t\t\t\t\t:slices=\"${dotPath(fieldPath)}\"\n\t\t\t\t\t\t:components=\"components\"\n\t\t\t\t\t/>\n\t\t\t\t`,\n\t\t\t\thelpers,\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode,\n\t\t\t};\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t{{${dotPath(fieldPath)}}}\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n};\n"],"names":["path"],"mappings":";AAQA,MAAM,UAAU,CAAC,aAA8B;
|
|
1
|
+
{"version":3,"file":"snippet-read.js","sources":["../../../src/hooks/snippet-read.ts"],"sourcesContent":["import type {\n\tSliceMachineHelpers,\n\tSnippetReadHook,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst dotPath = (segments: string[]): string => {\n\treturn segments.join(\".\");\n};\n\nconst format = async (input: string, helpers: SliceMachineHelpers) => {\n\tconst formattedInput = await helpers.format(input, undefined, {\n\t\tincludeNewlineAtEnd: false,\n\t\tprettier: {\n\t\t\tparser: \"vue\",\n\t\t},\n\t});\n\n\treturn formattedInput.endsWith(\";\")\n\t\t? formattedInput.substring(0, formattedInput.length - 1)\n\t\t: formattedInput;\n};\n\nexport const snippetRead: SnippetReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst { fieldPath, itemName } = data;\n\n\tconst label = \"Vue\";\n\n\tswitch (data.model.type) {\n\t\tcase \"StructuredText\": {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (rich)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicRichText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: `${label} (plain)`,\n\t\t\t\t\tlanguage: \"vue\",\n\t\t\t\t\tcode: await format(\n\t\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<PrismicText :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t`,\n\t\t\t\t\t\thelpers,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst repeat = data.model.config?.repeat ?? false;\n\t\t\tconst allowText = data.model.config?.allowText ?? false;\n\n\t\t\tconst allowVariants = Boolean(data.model.config?.variants);\n\t\t\tconst variant = (path: string) =>\n\t\t\t\tallowVariants ? ` :class=\"${path}.variant\"` : \"\";\n\n\t\t\tconst path = dotPath(fieldPath);\n\n\t\t\tlet codeText;\n\t\t\tif (!repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)}>Link</PrismicLink>\n\t\t\t\t`;\n\t\t\t} else if (!repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<PrismicLink :field=\"${path}\"${variant(path)} />\n\t\t\t\t`;\n\t\t\t} else if (repeat && !allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")}>Link</PrismicLink>\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else if (repeat && allowText) {\n\t\t\t\tcodeText = stripIndent`\n\t\t\t\t\t<template v-for=\"link in ${path}\" :key=\"link.key\">\n\t\t\t\t\t\t<PrismicLink :field=\"link\"${variant(\"link\")} />\n\t\t\t\t\t</template>\n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Invalid configuration.\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(codeText, helpers),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicImage :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicTable :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t\t<PrismicEmbed :field=\"${dotPath(fieldPath)}\" />\n\t\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t<template v-for=\"${itemName} in ${dotPath(fieldPath)}\">\n\t\t\t\t\t\t\t{{ ${itemName} }}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst code = await format(\n\t\t\t\tstripIndent`\n\t\t\t\t\t<SliceZone\n\t\t\t\t\t\t:slices=\"${dotPath(fieldPath)}\"\n\t\t\t\t\t\t:components=\"components\"\n\t\t\t\t\t/>\n\t\t\t\t`,\n\t\t\t\thelpers,\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode,\n\t\t\t};\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tlanguage: \"vue\",\n\t\t\t\tcode: await format(\n\t\t\t\t\tstripIndent`\n\t\t\t\t\t\t{{${dotPath(fieldPath)}}}\n\t\t\t\t\t`,\n\t\t\t\t\thelpers,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n};\n"],"names":["path"],"mappings":";AAQA,MAAM,UAAU,CAAC,aAA8B;AAC9C,SAAO,SAAS,KAAK,GAAG;AACzB;AAEA,MAAM,SAAS,OAAO,OAAe,YAAgC;AACpE,QAAM,iBAAiB,MAAM,QAAQ,OAAO,OAAO,QAAW;AAAA,IAC7D,qBAAqB;AAAA,IACrB,UAAU;AAAA,MACT,QAAQ;AAAA,IAAA;AAAA,EACR,CACD;AAED,SAAO,eAAe,SAAS,GAAG,IAC/B,eAAe,UAAU,GAAG,eAAe,SAAS,CAAC,IACrD;AACJ;AAEO,MAAM,cAA8C,OAC1D,MACA,EAAE,cACC;;AACH,QAAM,EAAE,WAAW,SAAA,IAAa;AAEhC,QAAM,QAAQ;AAEd,UAAQ,KAAK,MAAM,MAAA;AAAA,IAClB,KAAK,kBAAkB;AACtB,aAAO;AAAA,QACN;AAAA,UACC,OAAO,GAAG,KAAK;AAAA,UACf,UAAU;AAAA,UACV,MAAM,MAAM,OACX;AAAA,iCAC2B,QAAQ,SAAS,CAAC;AAAA,QAE7C,OAAO;AAAA,QAAA;AAAA,QAGT;AAAA,UACC,OAAO,GAAG,KAAK;AAAA,UACf,UAAU;AAAA,UACV,MAAM,MAAM,OACX;AAAA,6BACuB,QAAQ,SAAS,CAAC;AAAA,QAEzC,OAAO;AAAA,QAAA;AAAA,MAER;AAAA,IAEH;AAAA,IAEA,KAAK,QAAQ;AACZ,YAAM,WAAS,UAAK,MAAM,WAAX,mBAAmB,WAAU;AAC5C,YAAM,cAAY,UAAK,MAAM,WAAX,mBAAmB,cAAa;AAElD,YAAM,gBAAgB,SAAQ,UAAK,MAAM,WAAX,mBAAmB,QAAQ;AACzD,YAAM,UAAU,CAACA,UAChB,gBAAgB,YAAYA,KAAI,cAAc;AAE/C,YAAM,OAAO,QAAQ,SAAS;AAE9B,UAAI;AACJ,UAAI,CAAC,UAAU,CAAC,WAAW;AAC1B,mBAAW;AAAA,4BACa,IAAI,IAAI,QAAQ,IAAI,CAAC;AAAA;AAAA,MAE9C,WAAW,CAAC,UAAU,WAAW;AAChC,mBAAW;AAAA,4BACa,IAAI,IAAI,QAAQ,IAAI,CAAC;AAAA;AAAA,MAE9C,WAAW,UAAU,CAAC,WAAW;AAChC,mBAAW;AAAA,gCACiB,IAAI;AAAA,kCACF,QAAQ,MAAM,CAAC;AAAA;AAAA;AAAA,MAG9C,WAAW,UAAU,WAAW;AAC/B,mBAAW;AAAA,gCACiB,IAAI;AAAA,kCACF,QAAQ,MAAM,CAAC;AAAA;AAAA;AAAA,MAG9C,OAAO;AACN,cAAM,IAAI,MAAM,wBAAwB;AAAA,MACzC;AAEA,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OAAO,UAAU,OAAO;AAAA,MAAA;AAAA,IAEtC;AAAA,IAEA,KAAK,SAAS;AACb,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OACX;AAAA,+BAC0B,QAAQ,SAAS,CAAC;AAAA,SAE5C,OAAO;AAAA,MAAA;AAAA,IAGV;AAAA,IAEA,KAAK,SAAS;AACb,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OACX;AAAA,+BAC0B,QAAQ,SAAS,CAAC;AAAA,SAE5C,OAAO;AAAA,MAAA;AAAA,IAGV;AAAA,IAEA,KAAK,SAAS;AACb,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OACX;AAAA,+BAC0B,QAAQ,SAAS,CAAC;AAAA,SAE5C,OAAO;AAAA,MAAA;AAAA,IAGV;AAAA,IAEA,KAAK,SAAS;AACb,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OACX;AAAA,yBACoB,QAAQ,OAAO,QAAQ,SAAS,CAAC;AAAA,YAC9C,QAAQ;AAAA;AAAA,QAGf,OAAO;AAAA,MAAA;AAAA,IAGV;AAAA,IAEA,KAAK,UAAU;AACd,YAAM,OAAO,MAAM,OAClB;AAAA;AAAA,iBAEa,QAAQ,SAAS,CAAC;AAAA;AAAA;AAAA,OAI/B,OAAO;AAGR,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV;AAAA,MAAA;AAAA,IAEF;AAAA,IAEA,SAAS;AACR,aAAO;AAAA,QACN;AAAA,QACA,UAAU;AAAA,QACV,MAAM,MAAM,OACX;AAAA,UACK,QAAQ,SAAS,CAAC;AAAA,QAEvB,OAAO;AAAA,MAAA;AAAA,IAGV;AAAA,EAAA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSrcPath.cjs","sources":["../../../src/lib/buildSrcPath.ts"],"sourcesContent":["// TODO: If Nuxt provides a way to read `nuxt.config.js`'s `srcDir` value, we\n// can use the exact value given. The current implementation does not support\n// custom values different than \"src\".\n\nimport * as path from \"node:path\";\n\nimport type { SliceMachineHelpers } from \"@slicemachine/plugin-kit\";\nimport { checkHasProjectFile } from \"@slicemachine/plugin-kit/fs\";\n\nexport async function buildSrcPath(args: {\n\tfilename: string;\n\thelpers: SliceMachineHelpers;\n}): Promise<string> {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers: args.helpers,\n\t});\n\n\treturn hasSrcDirectory ? path.join(\"src\", args.filename) : args.filename;\n}\n"],"names":["checkHasProjectFile","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,eAAsB,aAAa,MAGlC;
|
|
1
|
+
{"version":3,"file":"buildSrcPath.cjs","sources":["../../../src/lib/buildSrcPath.ts"],"sourcesContent":["// TODO: If Nuxt provides a way to read `nuxt.config.js`'s `srcDir` value, we\n// can use the exact value given. The current implementation does not support\n// custom values different than \"src\".\n\nimport * as path from \"node:path\";\n\nimport type { SliceMachineHelpers } from \"@slicemachine/plugin-kit\";\nimport { checkHasProjectFile } from \"@slicemachine/plugin-kit/fs\";\n\nexport async function buildSrcPath(args: {\n\tfilename: string;\n\thelpers: SliceMachineHelpers;\n}): Promise<string> {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers: args.helpers,\n\t});\n\n\treturn hasSrcDirectory ? path.join(\"src\", args.filename) : args.filename;\n}\n"],"names":["checkHasProjectFile","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,eAAsB,aAAa,MAGlC;AACA,QAAM,kBAAkB,MAAMA,uBAAoB;AAAA,IACjD,UAAU;AAAA,IACV,SAAS,KAAK;AAAA,EAAA,CACd;AAED,SAAO,kBAAkBC,gBAAK,KAAK,OAAO,KAAK,QAAQ,IAAI,KAAK;AACjE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSrcPath.js","sources":["../../../src/lib/buildSrcPath.ts"],"sourcesContent":["// TODO: If Nuxt provides a way to read `nuxt.config.js`'s `srcDir` value, we\n// can use the exact value given. The current implementation does not support\n// custom values different than \"src\".\n\nimport * as path from \"node:path\";\n\nimport type { SliceMachineHelpers } from \"@slicemachine/plugin-kit\";\nimport { checkHasProjectFile } from \"@slicemachine/plugin-kit/fs\";\n\nexport async function buildSrcPath(args: {\n\tfilename: string;\n\thelpers: SliceMachineHelpers;\n}): Promise<string> {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers: args.helpers,\n\t});\n\n\treturn hasSrcDirectory ? path.join(\"src\", args.filename) : args.filename;\n}\n"],"names":[],"mappings":";;AASA,eAAsB,aAAa,MAGlC;
|
|
1
|
+
{"version":3,"file":"buildSrcPath.js","sources":["../../../src/lib/buildSrcPath.ts"],"sourcesContent":["// TODO: If Nuxt provides a way to read `nuxt.config.js`'s `srcDir` value, we\n// can use the exact value given. The current implementation does not support\n// custom values different than \"src\".\n\nimport * as path from \"node:path\";\n\nimport type { SliceMachineHelpers } from \"@slicemachine/plugin-kit\";\nimport { checkHasProjectFile } from \"@slicemachine/plugin-kit/fs\";\n\nexport async function buildSrcPath(args: {\n\tfilename: string;\n\thelpers: SliceMachineHelpers;\n}): Promise<string> {\n\tconst hasSrcDirectory = await checkHasProjectFile({\n\t\tfilename: \"src\",\n\t\thelpers: args.helpers,\n\t});\n\n\treturn hasSrcDirectory ? path.join(\"src\", args.filename) : args.filename;\n}\n"],"names":[],"mappings":";;AASA,eAAsB,aAAa,MAGlC;AACA,QAAM,kBAAkB,MAAM,oBAAoB;AAAA,IACjD,UAAU;AAAA,IACV,SAAS,KAAK;AAAA,EAAA,CACd;AAED,SAAO,kBAAkB,KAAK,KAAK,OAAO,KAAK,QAAQ,IAAI,KAAK;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIsTypeScriptProject.cjs","sources":["../../../src/lib/checkIsTypeScriptProject.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { checkIsTypeScriptProject as baseCheckIsTypeScriptProject } from \"@slicemachine/plugin-kit/fs\";\n\nimport { PluginOptions } from \"../types\";\n\ntype CheckIsTypeScriptProjectArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n\toptions: SliceMachineContext<PluginOptions>[\"options\"];\n};\n\nexport const checkIsTypeScriptProject = async (\n\targs: CheckIsTypeScriptProjectArgs,\n): Promise<boolean> => {\n\treturn (\n\t\targs.options.typescript ??\n\t\tbaseCheckIsTypeScriptProject({ helpers: args.helpers })\n\t);\n};\n"],"names":["baseCheckIsTypeScriptProject"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"checkIsTypeScriptProject.cjs","sources":["../../../src/lib/checkIsTypeScriptProject.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { checkIsTypeScriptProject as baseCheckIsTypeScriptProject } from \"@slicemachine/plugin-kit/fs\";\n\nimport { PluginOptions } from \"../types\";\n\ntype CheckIsTypeScriptProjectArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n\toptions: SliceMachineContext<PluginOptions>[\"options\"];\n};\n\nexport const checkIsTypeScriptProject = async (\n\targs: CheckIsTypeScriptProjectArgs,\n): Promise<boolean> => {\n\treturn (\n\t\targs.options.typescript ??\n\t\tbaseCheckIsTypeScriptProject({ helpers: args.helpers })\n\t);\n};\n"],"names":["baseCheckIsTypeScriptProject"],"mappings":";;;AAUO,MAAM,2BAA2B,OACvC,SACqB;AACrB,SACC,KAAK,QAAQ,cACbA,GAAAA,yBAA6B,EAAE,SAAS,KAAK,SAAS;AAExD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIsTypeScriptProject.js","sources":["../../../src/lib/checkIsTypeScriptProject.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { checkIsTypeScriptProject as baseCheckIsTypeScriptProject } from \"@slicemachine/plugin-kit/fs\";\n\nimport { PluginOptions } from \"../types\";\n\ntype CheckIsTypeScriptProjectArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n\toptions: SliceMachineContext<PluginOptions>[\"options\"];\n};\n\nexport const checkIsTypeScriptProject = async (\n\targs: CheckIsTypeScriptProjectArgs,\n): Promise<boolean> => {\n\treturn (\n\t\targs.options.typescript ??\n\t\tbaseCheckIsTypeScriptProject({ helpers: args.helpers })\n\t);\n};\n"],"names":["baseCheckIsTypeScriptProject"],"mappings":";
|
|
1
|
+
{"version":3,"file":"checkIsTypeScriptProject.js","sources":["../../../src/lib/checkIsTypeScriptProject.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { checkIsTypeScriptProject as baseCheckIsTypeScriptProject } from \"@slicemachine/plugin-kit/fs\";\n\nimport { PluginOptions } from \"../types\";\n\ntype CheckIsTypeScriptProjectArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n\toptions: SliceMachineContext<PluginOptions>[\"options\"];\n};\n\nexport const checkIsTypeScriptProject = async (\n\targs: CheckIsTypeScriptProjectArgs,\n): Promise<boolean> => {\n\treturn (\n\t\targs.options.typescript ??\n\t\tbaseCheckIsTypeScriptProject({ helpers: args.helpers })\n\t);\n};\n"],"names":["baseCheckIsTypeScriptProject"],"mappings":";AAUO,MAAM,2BAA2B,OACvC,SACqB;AACrB,SACC,KAAK,QAAQ,cACbA,2BAA6B,EAAE,SAAS,KAAK,SAAS;AAExD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJSFileExtension.cjs","sources":["../../../src/lib/getJSFileExtension.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\n\ntype GetJSFileExtensionArgs = Pick<\n\tSliceMachineContext<PluginOptions>,\n\t\"helpers\" | \"options\"\n>;\n\nexport const getJSFileExtension = async ({\n\thelpers,\n\toptions,\n}: GetJSFileExtensionArgs): Promise<string> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\treturn isTypeScriptProject ? \"ts\" : \"js\";\n};\n"],"names":["checkIsTypeScriptProject"],"mappings":";;;AAWO,MAAM,qBAAqB,OAAO,EACxC,SACA,cAC6C;
|
|
1
|
+
{"version":3,"file":"getJSFileExtension.cjs","sources":["../../../src/lib/getJSFileExtension.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\n\ntype GetJSFileExtensionArgs = Pick<\n\tSliceMachineContext<PluginOptions>,\n\t\"helpers\" | \"options\"\n>;\n\nexport const getJSFileExtension = async ({\n\thelpers,\n\toptions,\n}: GetJSFileExtensionArgs): Promise<string> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\treturn isTypeScriptProject ? \"ts\" : \"js\";\n};\n"],"names":["checkIsTypeScriptProject"],"mappings":";;;AAWO,MAAM,qBAAqB,OAAO,EACxC,SACA,cAC6C;AAC7C,QAAM,sBAAsB,MAAMA,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AAED,SAAO,sBAAsB,OAAO;AACrC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJSFileExtension.js","sources":["../../../src/lib/getJSFileExtension.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\n\ntype GetJSFileExtensionArgs = Pick<\n\tSliceMachineContext<PluginOptions>,\n\t\"helpers\" | \"options\"\n>;\n\nexport const getJSFileExtension = async ({\n\thelpers,\n\toptions,\n}: GetJSFileExtensionArgs): Promise<string> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\treturn isTypeScriptProject ? \"ts\" : \"js\";\n};\n"],"names":[],"mappings":";AAWO,MAAM,qBAAqB,OAAO,EACxC,SACA,cAC6C;
|
|
1
|
+
{"version":3,"file":"getJSFileExtension.js","sources":["../../../src/lib/getJSFileExtension.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\n\ntype GetJSFileExtensionArgs = Pick<\n\tSliceMachineContext<PluginOptions>,\n\t\"helpers\" | \"options\"\n>;\n\nexport const getJSFileExtension = async ({\n\thelpers,\n\toptions,\n}: GetJSFileExtensionArgs): Promise<string> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\treturn isTypeScriptProject ? \"ts\" : \"js\";\n};\n"],"names":[],"mappings":";AAWO,MAAM,qBAAqB,OAAO,EACxC,SACA,cAC6C;AAC7C,QAAM,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AAED,SAAO,sBAAsB,OAAO;AACrC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pascalCase.cjs","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import { pascalCase as basePascalCase } from \"pascal-case\";\n\n/**\n * Converts a string to a Pascal cased string.\n *\n * @param input - String to convert into a Pascal cased string.\n *\n * @returns Pascal cased string version of `input`.\n */\nexport const pascalCase = (...input: (string | undefined)[]): string => {\n\treturn basePascalCase(input.filter(Boolean).join(\" \"));\n};\n"],"names":["basePascalCase"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"pascalCase.cjs","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import { pascalCase as basePascalCase } from \"pascal-case\";\n\n/**\n * Converts a string to a Pascal cased string.\n *\n * @param input - String to convert into a Pascal cased string.\n *\n * @returns Pascal cased string version of `input`.\n */\nexport const pascalCase = (...input: (string | undefined)[]): string => {\n\treturn basePascalCase(input.filter(Boolean).join(\" \"));\n};\n"],"names":["basePascalCase"],"mappings":";;;AASO,MAAM,aAAa,IAAI,UAAyC;AACtE,SAAOA,aAAAA,WAAe,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC;AACtD;;"}
|