@plasmicapp/loader-gatsby 2.0.3 → 2.0.5
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/gatsby-node.js +3 -3
- package/dist/gatsby-node.js.map +1 -1
- package/dist/gatsby-ssr.js +1 -1
- package/dist/gatsby-ssr.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
package/dist/gatsby-node.js
CHANGED
|
@@ -103,10 +103,10 @@ var PLASMIC_DATA_TYPE = `
|
|
|
103
103
|
var SOURCE_WAIT_TIME = 3e3;
|
|
104
104
|
var SOURCE_MAX_WAIT_TIME = 1e4;
|
|
105
105
|
var allPaths = [];
|
|
106
|
-
var sourceNodes = (_0, _1) => __async(
|
|
106
|
+
var sourceNodes = (_0, _1) => __async(null, [_0, _1], function* ({ actions, createContentDigest, reporter }, opts) {
|
|
107
107
|
const { createNode, deleteNode } = actions;
|
|
108
108
|
let allComponents = [];
|
|
109
|
-
const refreshData = () => __async(
|
|
109
|
+
const refreshData = () => __async(null, null, function* () {
|
|
110
110
|
reporter.info(`[Plasmic Loader] - Creating nodes`);
|
|
111
111
|
const PLASMIC = (0, import_loader_react.initPlasmicLoader)({
|
|
112
112
|
projects: opts.projects,
|
|
@@ -261,7 +261,7 @@ var createSchemaCustomization = ({ actions }) => {
|
|
|
261
261
|
const { createTypes } = actions;
|
|
262
262
|
createTypes(PLASMIC_DATA_TYPE);
|
|
263
263
|
};
|
|
264
|
-
var createPages = (_0, _1) => __async(
|
|
264
|
+
var createPages = (_0, _1) => __async(null, [_0, _1], function* ({ graphql, actions, reporter, store }, opts) {
|
|
265
265
|
var _a;
|
|
266
266
|
const { defaultPlasmicPage } = opts;
|
|
267
267
|
const ignorePaths = opts.ignorePaths || [];
|
package/dist/gatsby-node.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/gatsby-node.ts", "../src/server-require.ts"],
|
|
4
4
|
"sourcesContent": ["import { ComponentMeta, LoaderBundleOutput } from \"@plasmicapp/loader-core\";\nimport {\n convertBundlesToComponentRenderData,\n InitOptions,\n initPlasmicLoader,\n matchesPagePath,\n} from \"@plasmicapp/loader-react\";\nimport type { PlasmicRemoteChangeWatcher as Watcher } from \"@plasmicapp/watcher\";\nimport { CreatePagesArgs, GatsbyNode, PluginOptions } from \"gatsby\";\nimport serverRequire from \"./server-require\";\n\nexport const onPreInit: GatsbyNode[\"onPreInit\"] = ({ reporter }) =>\n reporter.success(\"Loaded @plasmicapp/loader-gatsby\");\n\nexport type GatsbyPluginOptions = PluginOptions &\n InitOptions & {\n defaultPlasmicPage?: string;\n ignorePaths?: string[];\n };\n\nconst PLASMIC_NODE_NAME = \"plasmicData\";\n\nconst PLASMIC_DATA_TYPE = `\n type ${PLASMIC_NODE_NAME} implements Node {\n name: String!\n displayName: String!\n projectId: String!\n path: String\n isPage: Boolean!\n renderData: JSON!\n }\n\n type Query {\n plasmicComponents(componentNames: [String]!): JSON\n plasmicOptions: JSON\n }\n`;\n\nconst SOURCE_WAIT_TIME = 3000; // 3 seconds\nconst SOURCE_MAX_WAIT_TIME = 10000; // 10 seconds\n\nlet allPaths: string[] = [];\n\nexport const sourceNodes: GatsbyNode[\"sourceNodes\"] = async (\n { actions, createContentDigest, reporter },\n opts: GatsbyPluginOptions\n) => {\n const { createNode, deleteNode } = actions;\n\n let allComponents: any[] = [];\n\n const refreshData = async () => {\n reporter.info(`[Plasmic Loader] - Creating nodes`);\n\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n\n const components = await PLASMIC.fetchComponents();\n\n for (const component of allComponents) {\n const hasComponent = components.some((c) => c.name === component.name);\n /**\n * We shouldn't delete nodes that will be updated, if we delete all nodes\n * and then create it again, this could case the graphql layer to have no\n * plasmic data for some time, but this can be enough time to a re render\n * causing components that call a graphql query to plasmic data to crash\n * */\n if (!hasComponent) {\n deleteNode(component);\n reporter.verbose(`[Plasmic Loader] - Deleted node ${component.name}`);\n }\n }\n\n allComponents = [];\n for (const component of components) {\n const renderData = await PLASMIC.fetchComponentData({\n name: component.name,\n projectId: component.projectId,\n });\n\n const curComponent = {\n ...component,\n renderData,\n };\n\n const componentMeta = {\n // We use the same id as curComponent.id since loader-react might\n // expect the id to match plasmic component uuid.\n // id: getNodeId(component.projectId, component.name),\n parent: null,\n children: [],\n internal: {\n type: PLASMIC_NODE_NAME,\n contentDigest: createContentDigest(curComponent),\n },\n };\n\n const componentNode = Object.assign({}, curComponent, componentMeta);\n\n createNode(componentNode);\n reporter.verbose(\n `[Plasmic Loader] - Created component node ${component.name}`\n );\n allComponents.push(componentNode);\n }\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n const debounce = serverRequire(\"lodash/debounce\");\n const triggerSourcing = debounce(refreshData, SOURCE_WAIT_TIME, {\n maxWait: SOURCE_MAX_WAIT_TIME,\n });\n\n try {\n const PlasmicRemoteChangeWatcher = serverRequire(\"@plasmicapp/watcher\")\n .PlasmicRemoteChangeWatcher as typeof Watcher;\n\n const watcher = new PlasmicRemoteChangeWatcher({\n projects: opts.projects,\n host: opts.host,\n });\n\n watcher.subscribe({\n onUpdate: () => {\n if (opts.preview) {\n triggerSourcing();\n }\n },\n onPublish: () => {\n if (!opts.preview) {\n triggerSourcing();\n }\n },\n });\n } catch (e) {\n console.warn(\"Couldn't subscribe to Plasmic changes\", e);\n }\n }\n\n await refreshData();\n};\n\nasync function getAllNodes(nodeModel: any, type: any) {\n try {\n const { entries } = await nodeModel.findAll({ type });\n return Array.from(entries);\n } catch (_) {\n // Gatsby < v4 does not have `nodeModel.findAll`, so we try to use the\n // deprecated `nodeModel.getAllNodes` instead.\n return nodeModel.getAllNodes({ type });\n }\n}\n\nexport const createResolvers: GatsbyNode[\"createResolvers\"] = (\n { createResolvers },\n opts\n) => {\n createResolvers({\n Query: {\n plasmicComponents: {\n type: \"JSON\",\n args: {\n componentNames: `[String]!`,\n },\n async resolve(\n _source: unknown,\n args: { componentNames: string[] },\n context: any,\n _info: unknown\n ) {\n const { componentNames } = args;\n\n const components = await getAllNodes(\n context.nodeModel,\n PLASMIC_NODE_NAME\n );\n\n const bundles: LoaderBundleOutput[] = [];\n const compMetas: (ComponentMeta & {\n params?: Record<string, string>;\n })[] = [];\n for (const component of components) {\n if (\n componentNames.includes(component.name) ||\n componentNames.includes(component.displayName) ||\n !!(\n component.path &&\n componentNames.some((lookup) =>\n matchesPagePath(component.path, lookup)\n )\n )\n ) {\n const bundle = component.renderData?.bundle;\n if (bundle) {\n bundles.push(bundle);\n\n let meta = component;\n\n // If component is a page, try to parse dynamic params.\n if (component.path) {\n for (const lookup of componentNames) {\n const match = matchesPagePath(component.path, lookup);\n if (match) {\n meta = { ...meta, params: match.params };\n break;\n }\n }\n }\n\n compMetas.push(meta);\n }\n }\n }\n\n const renderData = convertBundlesToComponentRenderData(\n bundles,\n compMetas\n );\n\n renderData?.entryCompMetas.sort(\n (meta1, meta2) =>\n // We sort the matched component metas by the number of path params, so\n // if there are two pages `/products/foo` and `/products/[slug]`,\n // the first one will have higher precedence.\n Array.from(Object.keys(meta1.params || {})).length -\n Array.from(Object.keys(meta2.params || {})).length\n );\n\n return renderData;\n },\n },\n plasmicOptions: {\n type: \"JSON\",\n resolve() {\n return {\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n };\n },\n },\n },\n });\n};\n\nexport const createSchemaCustomization: GatsbyNode[\"createSchemaCustomization\"] =\n ({ actions }) => {\n const { createTypes } = actions;\n createTypes(PLASMIC_DATA_TYPE);\n };\n\ninterface LoaderGatsbyPluginOptions extends GatsbyPluginOptions {\n defaultPlasmicPage: string;\n}\n\nexport const createPages: GatsbyNode[\"createPages\"] = async (\n { graphql, actions, reporter, store }: CreatePagesArgs,\n opts: LoaderGatsbyPluginOptions\n) => {\n const { defaultPlasmicPage } = opts;\n\n const ignorePaths = opts.ignorePaths || [];\n\n if (defaultPlasmicPage) {\n reporter.info(`[Plasmic Loader] - Creating pages`);\n\n const { createPage, deletePage } = actions;\n const result = await graphql<{\n allPlasmicData: { nodes: Array<{ path: string }> };\n }>(`\n query {\n allPlasmicData(filter: { isPage: { eq: true } }) {\n nodes {\n path\n }\n }\n }\n `);\n\n const pages = result.data?.allPlasmicData.nodes;\n if (!pages) {\n reporter.error(`[Plasmic Loader] - GraphQL did not return pages`);\n return;\n }\n\n for (const originalPath of allPaths) {\n // `deletePage` might throw if the path is not in the expected format.\n // We first check if the pages include the original path, and, if not,\n // we assume it's due to an extra / missing trailing slash and try again.\n let path = originalPath;\n try {\n // Store is considered private API so use it only inside try-catch\n const storedPages = store.getState().pages;\n if (!storedPages.get(path)) {\n path = path.match(/\\w\\/$/) ? path.replace(/\\/$/, \"\") : `${path}/`;\n if (!storedPages.get(path)) {\n path = originalPath;\n }\n }\n } catch {\n path = originalPath;\n }\n deletePage({\n path,\n component: defaultPlasmicPage,\n });\n reporter.verbose(`[Plasmic Loader] - Deleted page ${path}`);\n }\n\n allPaths = [];\n\n for (const page of pages) {\n const path = page.path;\n if (ignorePaths.includes(path) || ignorePaths.includes(path + \"/\")) {\n continue;\n }\n allPaths.push(page.path);\n\n createPage({\n path: page.path,\n component: defaultPlasmicPage,\n context: {},\n });\n reporter.verbose(`[Plasmic Loader] - Created page ${page.path}`);\n }\n }\n};\n", "let secretRequire: NodeRequire | undefined;\ntry {\n // Secretly use require without webpack knowing\n secretRequire = eval(\"require\");\n} catch (err) {\n secretRequire = undefined;\n}\n\nexport default function serverRequire(module: string) {\n if (!secretRequire) {\n throw new Error(\n `Unexpected serverRequire() -- can only do this from a Node server!`\n );\n }\n return secretRequire(module);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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,OAAO,IAAI,KAAK,QAAQ,OAAO,EAAE,IAAI,GAAG,IAAI;AAC9D,cAAI,CAAC,YAAY,IAAI,IAAI,GAAG;AAC1B,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF,SAAQ;AACN,eAAO;AAAA,MACT;AACA,iBAAW;AAAA,QACT;AAAA,QACA,WAAW;AAAA,MACb,CAAC;AACD,eAAS,QAAQ,mCAAmC,IAAI,EAAE;AAAA,IAC5D;AAEA,eAAW,CAAC;AAEZ,eAAW,QAAQ,OAAO;AACxB,YAAM,OAAO,KAAK;AAClB,UAAI,YAAY,SAAS,IAAI,KAAK,YAAY,SAAS,OAAO,GAAG,GAAG;AAClE;AAAA,MACF;AACA,eAAS,KAAK,KAAK,IAAI;AAEvB,iBAAW;AAAA,QACT,MAAM,KAAK;AAAA,QACX,WAAW;AAAA,QACX,SAAS,CAAC;AAAA,MACZ,CAAC;AACD,eAAS,QAAQ,mCAAmC,KAAK,IAAI,EAAE;AAAA,IACjE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module", "createResolvers", "_a"]
|
|
7
7
|
}
|
package/dist/gatsby-ssr.js
CHANGED
|
@@ -68,7 +68,7 @@ function fetchServerFiles(opts) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
var replaceRenderer = (_0, _1) => __async(
|
|
71
|
+
var replaceRenderer = (_0, _1) => __async(null, [_0, _1], function* ({ bodyComponent, replaceBodyHTMLString }, opts) {
|
|
72
72
|
yield fetchServerFiles(opts);
|
|
73
73
|
replaceBodyHTMLString((0, import_server.renderToString)(bodyComponent));
|
|
74
74
|
});
|
package/dist/gatsby-ssr.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/gatsby-ssr.ts"],
|
|
4
4
|
"sourcesContent": ["import { initPlasmicLoader } from \"@plasmicapp/loader-react\";\nimport { renderToString } from \"react-dom/server\";\nimport type { GatsbyPluginOptions } from \"./gatsby-node\";\n\nlet loadedProjects = new Set<string>();\n\nexport async function fetchServerFiles(opts: GatsbyPluginOptions) {\n if (\n opts?.projects &&\n Array.isArray(opts.projects) &&\n opts.projects.every((p) => !!p.token && !!p.id)\n ) {\n const projectKeys = opts.projects.map(\n (project) => `${project.id}@${project.version}:${project.token}`\n );\n if (projectKeys.some((key) => !loadedProjects.has(key))) {\n loadedProjects.clear();\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n const components = await PLASMIC.fetchComponents();\n await PLASMIC.maybeFetchComponentData(...components);\n projectKeys.forEach((key) => loadedProjects.add(key));\n }\n }\n}\n\nexport const replaceRenderer = async (\n { bodyComponent, replaceBodyHTMLString }: any,\n opts: GatsbyPluginOptions\n) => {\n await fetchServerFiles(opts);\n replaceBodyHTMLString(renderToString(bodyComponent));\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAkC;AAClC,oBAA+B;AAG/B,IAAI,iBAAiB,oBAAI,IAAY;AAErC,SAAsB,iBAAiB,MAA2B;AAAA;AAChE,SACE,6BAAM,aACN,MAAM,QAAQ,KAAK,QAAQ,KAC3B,KAAK,SAAS,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,GAC9C;AACA,YAAM,cAAc,KAAK,SAAS;AAAA,QAChC,CAAC,YAAY,GAAG,QAAQ,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAkC;AAClC,oBAA+B;AAG/B,IAAI,iBAAiB,oBAAI,IAAY;AAErC,SAAsB,iBAAiB,MAA2B;AAAA;AAChE,SACE,6BAAM,aACN,MAAM,QAAQ,KAAK,QAAQ,KAC3B,KAAK,SAAS,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,GAC9C;AACA,YAAM,cAAc,KAAK,SAAS;AAAA,QAChC,CAAC,YAAY,GAAG,QAAQ,EAAE,IAAI,QAAQ,OAAO,IAAI,QAAQ,KAAK;AAAA,MAChE;AACA,UAAI,YAAY,KAAK,CAAC,QAAQ,CAAC,eAAe,IAAI,GAAG,CAAC,GAAG;AACvD,uBAAe,MAAM;AACrB,cAAM,cAAU,uCAAkB;AAAA,UAChC,UAAU,KAAK;AAAA,UACf,SAAS,KAAK;AAAA,UACd,MAAM,KAAK;AAAA,UACX,UAAU;AAAA,QACZ,CAAC;AACD,cAAM,aAAa,MAAM,QAAQ,gBAAgB;AACjD,cAAM,QAAQ,wBAAwB,GAAG,UAAU;AACnD,oBAAY,QAAQ,CAAC,QAAQ,eAAe,IAAI,GAAG,CAAC;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AAAA;AAEO,IAAM,kBAAkB,CAC7B,IACA,OACG,eAFH,IACA,KACG,WAFH,EAAE,eAAe,sBAAsB,GACvC,MACG;AACH,QAAM,iBAAiB,IAAI;AAC3B,4BAAsB,8BAAe,aAAa,CAAC;AACrD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ComponentMeta } from '@plasmicapp/loader-react';
|
|
|
3
3
|
import { ComponentRenderData } from '@plasmicapp/loader-react';
|
|
4
4
|
import { DataCtxReader } from '@plasmicapp/loader-react';
|
|
5
5
|
import { DataProvider } from '@plasmicapp/loader-react';
|
|
6
|
+
import { extractPlasmicQueryData } from '@plasmicapp/loader-react';
|
|
6
7
|
import { GatsbyNode } from 'gatsby';
|
|
7
8
|
import { InitOptions } from '@plasmicapp/loader-react';
|
|
8
9
|
import { PageMeta } from '@plasmicapp/loader-react';
|
|
@@ -39,7 +40,9 @@ export { DataCtxReader }
|
|
|
39
40
|
|
|
40
41
|
export { DataProvider }
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
export { extractPlasmicQueryData }
|
|
44
|
+
|
|
45
|
+
export declare type GatsbyPluginOptions = PluginOptions & InitOptions & {
|
|
43
46
|
defaultPlasmicPage?: string;
|
|
44
47
|
ignorePaths?: string[];
|
|
45
48
|
};
|
package/dist/index.js
CHANGED
|
@@ -65,8 +65,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// src/index.ts
|
|
68
|
-
var
|
|
69
|
-
__export(
|
|
68
|
+
var index_exports = {};
|
|
69
|
+
__export(index_exports, {
|
|
70
70
|
DataCtxReader: () => import_loader_react4.DataCtxReader,
|
|
71
71
|
DataProvider: () => import_loader_react4.DataProvider,
|
|
72
72
|
PageParamsProvider: () => import_loader_react4.PageParamsProvider,
|
|
@@ -76,6 +76,7 @@ __export(src_exports, {
|
|
|
76
76
|
PlasmicRootProvider: () => import_loader_react4.PlasmicRootProvider,
|
|
77
77
|
createPages: () => createPages,
|
|
78
78
|
createResolvers: () => createResolvers,
|
|
79
|
+
extractPlasmicQueryData: () => import_loader_react4.extractPlasmicQueryData,
|
|
79
80
|
initPlasmicLoader: () => initPlasmicLoader3,
|
|
80
81
|
repeatedElement: () => import_loader_react4.repeatedElement,
|
|
81
82
|
replaceRenderer: () => replaceRenderer,
|
|
@@ -87,7 +88,7 @@ __export(src_exports, {
|
|
|
87
88
|
useSelector: () => import_loader_react4.useSelector,
|
|
88
89
|
useSelectors: () => import_loader_react4.useSelectors
|
|
89
90
|
});
|
|
90
|
-
module.exports = __toCommonJS(
|
|
91
|
+
module.exports = __toCommonJS(index_exports);
|
|
91
92
|
var import_loader_react4 = require("@plasmicapp/loader-react");
|
|
92
93
|
|
|
93
94
|
// src/gatsby-node.ts
|
|
@@ -129,10 +130,10 @@ var PLASMIC_DATA_TYPE = `
|
|
|
129
130
|
var SOURCE_WAIT_TIME = 3e3;
|
|
130
131
|
var SOURCE_MAX_WAIT_TIME = 1e4;
|
|
131
132
|
var allPaths = [];
|
|
132
|
-
var sourceNodes = (_0, _1) => __async(
|
|
133
|
+
var sourceNodes = (_0, _1) => __async(null, [_0, _1], function* ({ actions, createContentDigest, reporter }, opts) {
|
|
133
134
|
const { createNode, deleteNode } = actions;
|
|
134
135
|
let allComponents = [];
|
|
135
|
-
const refreshData = () => __async(
|
|
136
|
+
const refreshData = () => __async(null, null, function* () {
|
|
136
137
|
reporter.info(`[Plasmic Loader] - Creating nodes`);
|
|
137
138
|
const PLASMIC = (0, import_loader_react.initPlasmicLoader)({
|
|
138
139
|
projects: opts.projects,
|
|
@@ -283,7 +284,7 @@ var createResolvers = ({ createResolvers: createResolvers2 }, opts) => {
|
|
|
283
284
|
}
|
|
284
285
|
});
|
|
285
286
|
};
|
|
286
|
-
var createPages = (_0, _1) => __async(
|
|
287
|
+
var createPages = (_0, _1) => __async(null, [_0, _1], function* ({ graphql, actions, reporter, store }, opts) {
|
|
287
288
|
var _a;
|
|
288
289
|
const { defaultPlasmicPage } = opts;
|
|
289
290
|
const ignorePaths = opts.ignorePaths || [];
|
|
@@ -365,7 +366,7 @@ function fetchServerFiles(opts) {
|
|
|
365
366
|
}
|
|
366
367
|
});
|
|
367
368
|
}
|
|
368
|
-
var replaceRenderer = (_0, _1) => __async(
|
|
369
|
+
var replaceRenderer = (_0, _1) => __async(null, [_0, _1], function* ({ bodyComponent, replaceBodyHTMLString }, opts) {
|
|
369
370
|
yield fetchServerFiles(opts);
|
|
370
371
|
replaceBodyHTMLString((0, import_server.renderToString)(bodyComponent));
|
|
371
372
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/gatsby-node.ts", "../src/server-require.ts", "../src/gatsby-ssr.ts", "../src/loader.ts"],
|
|
4
|
-
"sourcesContent": ["export {\n // Data context helpers.\n DataCtxReader,\n DataProvider,\n PageParamsProvider,\n PlasmicCanvasContext,\n PlasmicCanvasHost,\n PlasmicComponent,\n PlasmicRootProvider,\n repeatedElement,\n useDataEnv,\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n usePlasmicComponent,\n useSelector,\n useSelectors,\n} from \"@plasmicapp/loader-react\";\nexport type {\n CodeComponentMeta,\n ComponentMeta,\n ComponentRenderData,\n InitOptions,\n PageMeta,\n PageMetadata,\n PlasmicTranslator,\n PropType,\n TokenRegistration,\n} from \"@plasmicapp/loader-react\";\nexport { createPages, createResolvers, sourceNodes } from \"./gatsby-node\";\nexport { replaceRenderer } from \"./gatsby-ssr\";\nexport { initPlasmicLoader } from \"./loader\";\n", "import { ComponentMeta, LoaderBundleOutput } from \"@plasmicapp/loader-core\";\nimport {\n convertBundlesToComponentRenderData,\n InitOptions,\n initPlasmicLoader,\n matchesPagePath,\n} from \"@plasmicapp/loader-react\";\nimport type { PlasmicRemoteChangeWatcher as Watcher } from \"@plasmicapp/watcher\";\nimport { CreatePagesArgs, GatsbyNode, PluginOptions } from \"gatsby\";\nimport serverRequire from \"./server-require\";\n\nexport const onPreInit: GatsbyNode[\"onPreInit\"] = ({ reporter }) =>\n reporter.success(\"Loaded @plasmicapp/loader-gatsby\");\n\nexport type GatsbyPluginOptions = PluginOptions &\n InitOptions & {\n defaultPlasmicPage?: string;\n ignorePaths?: string[];\n };\n\nconst PLASMIC_NODE_NAME = \"plasmicData\";\n\nconst PLASMIC_DATA_TYPE = `\n type ${PLASMIC_NODE_NAME} implements Node {\n name: String!\n displayName: String!\n projectId: String!\n path: String\n isPage: Boolean!\n renderData: JSON!\n }\n\n type Query {\n plasmicComponents(componentNames: [String]!): JSON\n plasmicOptions: JSON\n }\n`;\n\nconst SOURCE_WAIT_TIME = 3000; // 3 seconds\nconst SOURCE_MAX_WAIT_TIME = 10000; // 10 seconds\n\nlet allPaths: string[] = [];\n\nexport const sourceNodes: GatsbyNode[\"sourceNodes\"] = async (\n { actions, createContentDigest, reporter },\n opts: GatsbyPluginOptions\n) => {\n const { createNode, deleteNode } = actions;\n\n let allComponents: any[] = [];\n\n const refreshData = async () => {\n reporter.info(`[Plasmic Loader] - Creating nodes`);\n\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n\n const components = await PLASMIC.fetchComponents();\n\n for (const component of allComponents) {\n const hasComponent = components.some((c) => c.name === component.name);\n /**\n * We shouldn't delete nodes that will be updated, if we delete all nodes\n * and then create it again, this could case the graphql layer to have no\n * plasmic data for some time, but this can be enough time to a re render\n * causing components that call a graphql query to plasmic data to crash\n * */\n if (!hasComponent) {\n deleteNode(component);\n reporter.verbose(`[Plasmic Loader] - Deleted node ${component.name}`);\n }\n }\n\n allComponents = [];\n for (const component of components) {\n const renderData = await PLASMIC.fetchComponentData({\n name: component.name,\n projectId: component.projectId,\n });\n\n const curComponent = {\n ...component,\n renderData,\n };\n\n const componentMeta = {\n // We use the same id as curComponent.id since loader-react might\n // expect the id to match plasmic component uuid.\n // id: getNodeId(component.projectId, component.name),\n parent: null,\n children: [],\n internal: {\n type: PLASMIC_NODE_NAME,\n contentDigest: createContentDigest(curComponent),\n },\n };\n\n const componentNode = Object.assign({}, curComponent, componentMeta);\n\n createNode(componentNode);\n reporter.verbose(\n `[Plasmic Loader] - Created component node ${component.name}`\n );\n allComponents.push(componentNode);\n }\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n const debounce = serverRequire(\"lodash/debounce\");\n const triggerSourcing = debounce(refreshData, SOURCE_WAIT_TIME, {\n maxWait: SOURCE_MAX_WAIT_TIME,\n });\n\n try {\n const PlasmicRemoteChangeWatcher = serverRequire(\"@plasmicapp/watcher\")\n .PlasmicRemoteChangeWatcher as typeof Watcher;\n\n const watcher = new PlasmicRemoteChangeWatcher({\n projects: opts.projects,\n host: opts.host,\n });\n\n watcher.subscribe({\n onUpdate: () => {\n if (opts.preview) {\n triggerSourcing();\n }\n },\n onPublish: () => {\n if (!opts.preview) {\n triggerSourcing();\n }\n },\n });\n } catch (e) {\n console.warn(\"Couldn't subscribe to Plasmic changes\", e);\n }\n }\n\n await refreshData();\n};\n\nasync function getAllNodes(nodeModel: any, type: any) {\n try {\n const { entries } = await nodeModel.findAll({ type });\n return Array.from(entries);\n } catch (_) {\n // Gatsby < v4 does not have `nodeModel.findAll`, so we try to use the\n // deprecated `nodeModel.getAllNodes` instead.\n return nodeModel.getAllNodes({ type });\n }\n}\n\nexport const createResolvers: GatsbyNode[\"createResolvers\"] = (\n { createResolvers },\n opts\n) => {\n createResolvers({\n Query: {\n plasmicComponents: {\n type: \"JSON\",\n args: {\n componentNames: `[String]!`,\n },\n async resolve(\n _source: unknown,\n args: { componentNames: string[] },\n context: any,\n _info: unknown\n ) {\n const { componentNames } = args;\n\n const components = await getAllNodes(\n context.nodeModel,\n PLASMIC_NODE_NAME\n );\n\n const bundles: LoaderBundleOutput[] = [];\n const compMetas: (ComponentMeta & {\n params?: Record<string, string>;\n })[] = [];\n for (const component of components) {\n if (\n componentNames.includes(component.name) ||\n componentNames.includes(component.displayName) ||\n !!(\n component.path &&\n componentNames.some((lookup) =>\n matchesPagePath(component.path, lookup)\n )\n )\n ) {\n const bundle = component.renderData?.bundle;\n if (bundle) {\n bundles.push(bundle);\n\n let meta = component;\n\n // If component is a page, try to parse dynamic params.\n if (component.path) {\n for (const lookup of componentNames) {\n const match = matchesPagePath(component.path, lookup);\n if (match) {\n meta = { ...meta, params: match.params };\n break;\n }\n }\n }\n\n compMetas.push(meta);\n }\n }\n }\n\n const renderData = convertBundlesToComponentRenderData(\n bundles,\n compMetas\n );\n\n renderData?.entryCompMetas.sort(\n (meta1, meta2) =>\n // We sort the matched component metas by the number of path params, so\n // if there are two pages `/products/foo` and `/products/[slug]`,\n // the first one will have higher precedence.\n Array.from(Object.keys(meta1.params || {})).length -\n Array.from(Object.keys(meta2.params || {})).length\n );\n\n return renderData;\n },\n },\n plasmicOptions: {\n type: \"JSON\",\n resolve() {\n return {\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n };\n },\n },\n },\n });\n};\n\nexport const createSchemaCustomization: GatsbyNode[\"createSchemaCustomization\"] =\n ({ actions }) => {\n const { createTypes } = actions;\n createTypes(PLASMIC_DATA_TYPE);\n };\n\ninterface LoaderGatsbyPluginOptions extends GatsbyPluginOptions {\n defaultPlasmicPage: string;\n}\n\nexport const createPages: GatsbyNode[\"createPages\"] = async (\n { graphql, actions, reporter, store }: CreatePagesArgs,\n opts: LoaderGatsbyPluginOptions\n) => {\n const { defaultPlasmicPage } = opts;\n\n const ignorePaths = opts.ignorePaths || [];\n\n if (defaultPlasmicPage) {\n reporter.info(`[Plasmic Loader] - Creating pages`);\n\n const { createPage, deletePage } = actions;\n const result = await graphql<{\n allPlasmicData: { nodes: Array<{ path: string }> };\n }>(`\n query {\n allPlasmicData(filter: { isPage: { eq: true } }) {\n nodes {\n path\n }\n }\n }\n `);\n\n const pages = result.data?.allPlasmicData.nodes;\n if (!pages) {\n reporter.error(`[Plasmic Loader] - GraphQL did not return pages`);\n return;\n }\n\n for (const originalPath of allPaths) {\n // `deletePage` might throw if the path is not in the expected format.\n // We first check if the pages include the original path, and, if not,\n // we assume it's due to an extra / missing trailing slash and try again.\n let path = originalPath;\n try {\n // Store is considered private API so use it only inside try-catch\n const storedPages = store.getState().pages;\n if (!storedPages.get(path)) {\n path = path.match(/\\w\\/$/) ? path.replace(/\\/$/, \"\") : `${path}/`;\n if (!storedPages.get(path)) {\n path = originalPath;\n }\n }\n } catch {\n path = originalPath;\n }\n deletePage({\n path,\n component: defaultPlasmicPage,\n });\n reporter.verbose(`[Plasmic Loader] - Deleted page ${path}`);\n }\n\n allPaths = [];\n\n for (const page of pages) {\n const path = page.path;\n if (ignorePaths.includes(path) || ignorePaths.includes(path + \"/\")) {\n continue;\n }\n allPaths.push(page.path);\n\n createPage({\n path: page.path,\n component: defaultPlasmicPage,\n context: {},\n });\n reporter.verbose(`[Plasmic Loader] - Created page ${page.path}`);\n }\n }\n};\n", "let secretRequire: NodeRequire | undefined;\ntry {\n // Secretly use require without webpack knowing\n secretRequire = eval(\"require\");\n} catch (err) {\n secretRequire = undefined;\n}\n\nexport default function serverRequire(module: string) {\n if (!secretRequire) {\n throw new Error(\n `Unexpected serverRequire() -- can only do this from a Node server!`\n );\n }\n return secretRequire(module);\n}\n", "import { initPlasmicLoader } from \"@plasmicapp/loader-react\";\nimport { renderToString } from \"react-dom/server\";\nimport type { GatsbyPluginOptions } from \"./gatsby-node\";\n\nlet loadedProjects = new Set<string>();\n\nexport async function fetchServerFiles(opts: GatsbyPluginOptions) {\n if (\n opts?.projects &&\n Array.isArray(opts.projects) &&\n opts.projects.every((p) => !!p.token && !!p.id)\n ) {\n const projectKeys = opts.projects.map(\n (project) => `${project.id}@${project.version}:${project.token}`\n );\n if (projectKeys.some((key) => !loadedProjects.has(key))) {\n loadedProjects.clear();\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n const components = await PLASMIC.fetchComponents();\n await PLASMIC.maybeFetchComponentData(...components);\n projectKeys.forEach((key) => loadedProjects.add(key));\n }\n }\n}\n\nexport const replaceRenderer = async (\n { bodyComponent, replaceBodyHTMLString }: any,\n opts: GatsbyPluginOptions\n) => {\n await fetchServerFiles(opts);\n replaceBodyHTMLString(renderToString(bodyComponent));\n};\n", "import {\n InitOptions,\n initPlasmicLoader as initPlasmicLoaderReact,\n} from \"@plasmicapp/loader-react\";\nimport * as Gatsby from \"gatsby\";\n\nexport function initPlasmicLoader(opts: InitOptions) {\n const loader = initPlasmicLoaderReact({\n onClientSideFetch: \"warn\",\n ...opts,\n platform: \"gatsby\",\n });\n\n loader.registerModules({\n gatsby: Gatsby,\n });\n\n return loader;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAC,
|
|
4
|
+
"sourcesContent": ["export {\n // Data context helpers.\n DataCtxReader,\n DataProvider,\n PageParamsProvider,\n PlasmicCanvasContext,\n PlasmicCanvasHost,\n PlasmicComponent,\n PlasmicRootProvider,\n extractPlasmicQueryData,\n repeatedElement,\n useDataEnv,\n usePlasmicCanvasComponentInfo,\n usePlasmicCanvasContext,\n usePlasmicComponent,\n useSelector,\n useSelectors,\n} from \"@plasmicapp/loader-react\";\nexport type {\n CodeComponentMeta,\n ComponentMeta,\n ComponentRenderData,\n InitOptions,\n PageMeta,\n PageMetadata,\n PlasmicTranslator,\n PropType,\n TokenRegistration,\n} from \"@plasmicapp/loader-react\";\nexport { createPages, createResolvers, sourceNodes } from \"./gatsby-node\";\nexport type { GatsbyPluginOptions } from \"./gatsby-node\";\nexport { replaceRenderer } from \"./gatsby-ssr\";\nexport { initPlasmicLoader } from \"./loader\";\n", "import { ComponentMeta, LoaderBundleOutput } from \"@plasmicapp/loader-core\";\nimport {\n convertBundlesToComponentRenderData,\n InitOptions,\n initPlasmicLoader,\n matchesPagePath,\n} from \"@plasmicapp/loader-react\";\nimport type { PlasmicRemoteChangeWatcher as Watcher } from \"@plasmicapp/watcher\";\nimport { CreatePagesArgs, GatsbyNode, PluginOptions } from \"gatsby\";\nimport serverRequire from \"./server-require\";\n\nexport const onPreInit: GatsbyNode[\"onPreInit\"] = ({ reporter }) =>\n reporter.success(\"Loaded @plasmicapp/loader-gatsby\");\n\nexport type GatsbyPluginOptions = PluginOptions &\n InitOptions & {\n defaultPlasmicPage?: string;\n ignorePaths?: string[];\n };\n\nconst PLASMIC_NODE_NAME = \"plasmicData\";\n\nconst PLASMIC_DATA_TYPE = `\n type ${PLASMIC_NODE_NAME} implements Node {\n name: String!\n displayName: String!\n projectId: String!\n path: String\n isPage: Boolean!\n renderData: JSON!\n }\n\n type Query {\n plasmicComponents(componentNames: [String]!): JSON\n plasmicOptions: JSON\n }\n`;\n\nconst SOURCE_WAIT_TIME = 3000; // 3 seconds\nconst SOURCE_MAX_WAIT_TIME = 10000; // 10 seconds\n\nlet allPaths: string[] = [];\n\nexport const sourceNodes: GatsbyNode[\"sourceNodes\"] = async (\n { actions, createContentDigest, reporter },\n opts: GatsbyPluginOptions\n) => {\n const { createNode, deleteNode } = actions;\n\n let allComponents: any[] = [];\n\n const refreshData = async () => {\n reporter.info(`[Plasmic Loader] - Creating nodes`);\n\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n\n const components = await PLASMIC.fetchComponents();\n\n for (const component of allComponents) {\n const hasComponent = components.some((c) => c.name === component.name);\n /**\n * We shouldn't delete nodes that will be updated, if we delete all nodes\n * and then create it again, this could case the graphql layer to have no\n * plasmic data for some time, but this can be enough time to a re render\n * causing components that call a graphql query to plasmic data to crash\n * */\n if (!hasComponent) {\n deleteNode(component);\n reporter.verbose(`[Plasmic Loader] - Deleted node ${component.name}`);\n }\n }\n\n allComponents = [];\n for (const component of components) {\n const renderData = await PLASMIC.fetchComponentData({\n name: component.name,\n projectId: component.projectId,\n });\n\n const curComponent = {\n ...component,\n renderData,\n };\n\n const componentMeta = {\n // We use the same id as curComponent.id since loader-react might\n // expect the id to match plasmic component uuid.\n // id: getNodeId(component.projectId, component.name),\n parent: null,\n children: [],\n internal: {\n type: PLASMIC_NODE_NAME,\n contentDigest: createContentDigest(curComponent),\n },\n };\n\n const componentNode = Object.assign({}, curComponent, componentMeta);\n\n createNode(componentNode);\n reporter.verbose(\n `[Plasmic Loader] - Created component node ${component.name}`\n );\n allComponents.push(componentNode);\n }\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n const debounce = serverRequire(\"lodash/debounce\");\n const triggerSourcing = debounce(refreshData, SOURCE_WAIT_TIME, {\n maxWait: SOURCE_MAX_WAIT_TIME,\n });\n\n try {\n const PlasmicRemoteChangeWatcher = serverRequire(\"@plasmicapp/watcher\")\n .PlasmicRemoteChangeWatcher as typeof Watcher;\n\n const watcher = new PlasmicRemoteChangeWatcher({\n projects: opts.projects,\n host: opts.host,\n });\n\n watcher.subscribe({\n onUpdate: () => {\n if (opts.preview) {\n triggerSourcing();\n }\n },\n onPublish: () => {\n if (!opts.preview) {\n triggerSourcing();\n }\n },\n });\n } catch (e) {\n console.warn(\"Couldn't subscribe to Plasmic changes\", e);\n }\n }\n\n await refreshData();\n};\n\nasync function getAllNodes(nodeModel: any, type: any) {\n try {\n const { entries } = await nodeModel.findAll({ type });\n return Array.from(entries);\n } catch (_) {\n // Gatsby < v4 does not have `nodeModel.findAll`, so we try to use the\n // deprecated `nodeModel.getAllNodes` instead.\n return nodeModel.getAllNodes({ type });\n }\n}\n\nexport const createResolvers: GatsbyNode[\"createResolvers\"] = (\n { createResolvers },\n opts\n) => {\n createResolvers({\n Query: {\n plasmicComponents: {\n type: \"JSON\",\n args: {\n componentNames: `[String]!`,\n },\n async resolve(\n _source: unknown,\n args: { componentNames: string[] },\n context: any,\n _info: unknown\n ) {\n const { componentNames } = args;\n\n const components = await getAllNodes(\n context.nodeModel,\n PLASMIC_NODE_NAME\n );\n\n const bundles: LoaderBundleOutput[] = [];\n const compMetas: (ComponentMeta & {\n params?: Record<string, string>;\n })[] = [];\n for (const component of components) {\n if (\n componentNames.includes(component.name) ||\n componentNames.includes(component.displayName) ||\n !!(\n component.path &&\n componentNames.some((lookup) =>\n matchesPagePath(component.path, lookup)\n )\n )\n ) {\n const bundle = component.renderData?.bundle;\n if (bundle) {\n bundles.push(bundle);\n\n let meta = component;\n\n // If component is a page, try to parse dynamic params.\n if (component.path) {\n for (const lookup of componentNames) {\n const match = matchesPagePath(component.path, lookup);\n if (match) {\n meta = { ...meta, params: match.params };\n break;\n }\n }\n }\n\n compMetas.push(meta);\n }\n }\n }\n\n const renderData = convertBundlesToComponentRenderData(\n bundles,\n compMetas\n );\n\n renderData?.entryCompMetas.sort(\n (meta1, meta2) =>\n // We sort the matched component metas by the number of path params, so\n // if there are two pages `/products/foo` and `/products/[slug]`,\n // the first one will have higher precedence.\n Array.from(Object.keys(meta1.params || {})).length -\n Array.from(Object.keys(meta2.params || {})).length\n );\n\n return renderData;\n },\n },\n plasmicOptions: {\n type: \"JSON\",\n resolve() {\n return {\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n };\n },\n },\n },\n });\n};\n\nexport const createSchemaCustomization: GatsbyNode[\"createSchemaCustomization\"] =\n ({ actions }) => {\n const { createTypes } = actions;\n createTypes(PLASMIC_DATA_TYPE);\n };\n\ninterface LoaderGatsbyPluginOptions extends GatsbyPluginOptions {\n defaultPlasmicPage: string;\n}\n\nexport const createPages: GatsbyNode[\"createPages\"] = async (\n { graphql, actions, reporter, store }: CreatePagesArgs,\n opts: LoaderGatsbyPluginOptions\n) => {\n const { defaultPlasmicPage } = opts;\n\n const ignorePaths = opts.ignorePaths || [];\n\n if (defaultPlasmicPage) {\n reporter.info(`[Plasmic Loader] - Creating pages`);\n\n const { createPage, deletePage } = actions;\n const result = await graphql<{\n allPlasmicData: { nodes: Array<{ path: string }> };\n }>(`\n query {\n allPlasmicData(filter: { isPage: { eq: true } }) {\n nodes {\n path\n }\n }\n }\n `);\n\n const pages = result.data?.allPlasmicData.nodes;\n if (!pages) {\n reporter.error(`[Plasmic Loader] - GraphQL did not return pages`);\n return;\n }\n\n for (const originalPath of allPaths) {\n // `deletePage` might throw if the path is not in the expected format.\n // We first check if the pages include the original path, and, if not,\n // we assume it's due to an extra / missing trailing slash and try again.\n let path = originalPath;\n try {\n // Store is considered private API so use it only inside try-catch\n const storedPages = store.getState().pages;\n if (!storedPages.get(path)) {\n path = path.match(/\\w\\/$/) ? path.replace(/\\/$/, \"\") : `${path}/`;\n if (!storedPages.get(path)) {\n path = originalPath;\n }\n }\n } catch {\n path = originalPath;\n }\n deletePage({\n path,\n component: defaultPlasmicPage,\n });\n reporter.verbose(`[Plasmic Loader] - Deleted page ${path}`);\n }\n\n allPaths = [];\n\n for (const page of pages) {\n const path = page.path;\n if (ignorePaths.includes(path) || ignorePaths.includes(path + \"/\")) {\n continue;\n }\n allPaths.push(page.path);\n\n createPage({\n path: page.path,\n component: defaultPlasmicPage,\n context: {},\n });\n reporter.verbose(`[Plasmic Loader] - Created page ${page.path}`);\n }\n }\n};\n", "let secretRequire: NodeRequire | undefined;\ntry {\n // Secretly use require without webpack knowing\n secretRequire = eval(\"require\");\n} catch (err) {\n secretRequire = undefined;\n}\n\nexport default function serverRequire(module: string) {\n if (!secretRequire) {\n throw new Error(\n `Unexpected serverRequire() -- can only do this from a Node server!`\n );\n }\n return secretRequire(module);\n}\n", "import { initPlasmicLoader } from \"@plasmicapp/loader-react\";\nimport { renderToString } from \"react-dom/server\";\nimport type { GatsbyPluginOptions } from \"./gatsby-node\";\n\nlet loadedProjects = new Set<string>();\n\nexport async function fetchServerFiles(opts: GatsbyPluginOptions) {\n if (\n opts?.projects &&\n Array.isArray(opts.projects) &&\n opts.projects.every((p) => !!p.token && !!p.id)\n ) {\n const projectKeys = opts.projects.map(\n (project) => `${project.id}@${project.version}:${project.token}`\n );\n if (projectKeys.some((key) => !loadedProjects.has(key))) {\n loadedProjects.clear();\n const PLASMIC = initPlasmicLoader({\n projects: opts.projects,\n preview: opts.preview,\n host: opts.host,\n platform: \"gatsby\",\n });\n const components = await PLASMIC.fetchComponents();\n await PLASMIC.maybeFetchComponentData(...components);\n projectKeys.forEach((key) => loadedProjects.add(key));\n }\n }\n}\n\nexport const replaceRenderer = async (\n { bodyComponent, replaceBodyHTMLString }: any,\n opts: GatsbyPluginOptions\n) => {\n await fetchServerFiles(opts);\n replaceBodyHTMLString(renderToString(bodyComponent));\n};\n", "import {\n InitOptions,\n initPlasmicLoader as initPlasmicLoaderReact,\n} from \"@plasmicapp/loader-react\";\nimport * as Gatsby from \"gatsby\";\n\nexport function initPlasmicLoader(opts: InitOptions) {\n const loader = initPlasmicLoaderReact({\n onClientSideFetch: \"warn\",\n ...opts,\n platform: \"gatsby\",\n });\n\n loader.registerModules({\n gatsby: Gatsby,\n });\n\n return loader;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAC,uBAiBO;;;AChBP,0BAKO;;;ACNP,IAAI;AACJ,IAAI;AAEF,kBAAgB,KAAK,SAAS;AAChC,SAAS,KAAK;AACZ,kBAAgB;AAClB;AAEe,SAAR,cAA+BC,SAAgB;AACpD,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,cAAcA,OAAM;AAC7B;;;ADKA,IAAM,oBAAoB;AAE1B,IAAM,oBAAoB;AAAA,SACjB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe1B,IAAM,mBAAmB;AACzB,IAAM,uBAAuB;AAE7B,IAAI,WAAqB,CAAC;AAEnB,IAAM,cAAyC,CACpD,IACA,OACG,eAFH,IACA,KACG,WAFH,EAAE,SAAS,qBAAqB,SAAS,GACzC,MACG;AACH,QAAM,EAAE,YAAY,WAAW,IAAI;AAEnC,MAAI,gBAAuB,CAAC;AAE5B,QAAM,cAAc,MAAY;AAC9B,aAAS,KAAK,mCAAmC;AAEjD,UAAM,cAAU,uCAAkB;AAAA,MAChC,UAAU,KAAK;AAAA,MACf,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,UAAU;AAAA,IACZ,CA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A,UACd,MAAM,KAAK;AAAA,UACX,UAAU;AAAA,QACZ,CAAC;AACD,cAAM,aAAa,MAAM,QAAQ,gBAAgB;AACjD,cAAM,QAAQ,wBAAwB,GAAG,UAAU;AACnD,oBAAY,QAAQ,CAAC,QAAQ,eAAe,IAAI,GAAG,CAAC;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AAAA;AAEO,IAAM,kBAAkB,CAC7B,IACA,OACG,eAFH,IACA,KACG,WAFH,EAAE,eAAe,sBAAsB,GACvC,MACG;AACH,QAAM,iBAAiB,IAAI;AAC3B,4BAAsB,8BAAe,aAAa,CAAC;AACrD;;;ACpCA,IAAAC,uBAGO;AACP,aAAwB;AAEjB,SAASC,mBAAkB,MAAmB;AACnD,QAAM,aAAS,qBAAAC,mBAAuB;AAAA,IACpC,mBAAmB;AAAA,KAChB,OAFiC;AAAA,IAGpC,UAAU;AAAA,EACZ,EAAC;AAED,SAAO,gBAAgB;AAAA,IACrB,QAAQ;AAAA,EACV,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": ["initPlasmicLoader", "import_loader_react", "module", "createResolvers", "_a", "import_loader_react", "import_loader_react", "initPlasmicLoader", "initPlasmicLoaderReact"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/loader-gatsby",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@plasmicapp/loader-core": "2.0.0",
|
|
57
|
-
"@plasmicapp/loader-react": "2.0.
|
|
57
|
+
"@plasmicapp/loader-react": "2.0.4",
|
|
58
58
|
"@plasmicapp/watcher": "1.0.84",
|
|
59
59
|
"lodash": "^4.17.21"
|
|
60
60
|
},
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"react": ">=18.0.0",
|
|
69
69
|
"react-dom": ">=18.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "c6d493ab33d8d50e512a6b0995aa882c8500d897"
|
|
72
72
|
}
|