@plasmicpkgs/plasmic-wordpress 0.0.156 → 0.0.157

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/index.esm.js CHANGED
@@ -175,13 +175,13 @@ function WordpressFetcher({
175
175
  const { data } = usePlasmicQueryData(
176
176
  queryType && wordpressUrl ? cacheKey : null,
177
177
  () => __async(this, null, function* () {
178
- return queryWordpress(
179
- ensure(wordpressUrl, "Wordpress URL must be specified"),
180
- ensure(queryType, "Query Type must be specified"),
178
+ return queryWordpress({
179
+ wordpressUrl,
180
+ queryType,
181
181
  queryOperator,
182
182
  filterValue,
183
183
  limit
184
- );
184
+ });
185
185
  })
186
186
  );
187
187
  const hasFilter = queryOperator && filterValue;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/wordpress.tsx", "../src/utils.ts"],
4
- "sourcesContent": ["import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n WordpressFetcher,\n WordpressFetcherMeta,\n WordpressField,\n WordpressFieldMeta,\n WordpressProvider,\n WordpressProviderMeta,\n} from \"./wordpress\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n } else {\n registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n }\n\n _registerComponent(WordpressFetcher, WordpressFetcherMeta);\n _registerComponent(WordpressField, WordpressFieldMeta);\n}\n\nexport * from \"./wordpress\";\n", "import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport { queryWordpress } from \"@plasmicpkgs/wordpress\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { ensure, queryOperators, type QueryOperator } from \"./utils\";\n\nconst modulePath = \"@plasmicpkgs/plasmic-wordpress\";\n\ninterface WordpressProviderProps {\n wordpressUrl?: string;\n}\n\nconst CredentialsContext = React.createContext<\n WordpressProviderProps | undefined\n>(undefined);\n\nexport const WordpressProviderMeta: GlobalContextMeta<WordpressProviderProps> =\n {\n name: \"WordpressProvider\",\n displayName: \"Wordpress Provider\",\n description: \"The endpoint of your Wordpress\",\n importName: \"WordpressProvider\",\n importPath: modulePath,\n props: {\n wordpressUrl: {\n type: \"string\",\n displayName: \"Wordpress URL\",\n description: \"URL of your Wordpress \",\n defaultValue: \"https://techcrunch.com/\",\n },\n },\n };\n\nexport function WordpressProvider({\n wordpressUrl,\n children,\n}: React.PropsWithChildren<WordpressProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ wordpressUrl }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface WordpressFetcherProps {\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n queryType?: \"posts\" | \"pages\";\n noAutoRepeat?: boolean;\n limit?: number;\n queryOperator?: QueryOperator;\n filterValue?: string;\n setControlContextData?: (data: {\n posts?: { value: string; label: string }[];\n pages?: { value: string; label: string }[];\n }) => void;\n}\n\nexport const WordpressFetcherMeta: ComponentMeta<WordpressFetcherProps> = {\n name: \"WordpressFetcher\",\n displayName: \"Wordpress Fetcher\",\n importName: \"WordpressFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Wordpress data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gridRowGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"WordpressField\",\n },\n },\n },\n queryType: {\n type: \"choice\",\n options: [\"posts\", \"pages\"],\n },\n queryOperator: {\n type: \"choice\",\n displayName: \"Query Operator\",\n description: \"Filter Parameter filter by\",\n options: () => {\n return queryOperators.map((item: any) => ({\n label: item?.label,\n value: item?.value,\n }));\n },\n hidden: (props) => !props.queryType,\n },\n\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter\",\n hidden: (props) => !props.queryOperator,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit\",\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description:\n \"Do not automatically repeat children for every posts or pages.\",\n defaultValue: false,\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Wordpress Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function WordpressFetcher({\n queryOperator,\n filterValue,\n noAutoRepeat,\n limit,\n queryType,\n children,\n className,\n noLayout,\n}: WordpressFetcherProps) {\n const { wordpressUrl } = ensure(\n useContext(CredentialsContext),\n \"WordpressFetcher must be used within a WordpressProvider\"\n );\n const cacheKey = JSON.stringify({\n queryOperator,\n filterValue,\n limit,\n queryType,\n wordpressUrl,\n });\n\n const { data } = usePlasmicQueryData<any | null>(\n queryType && wordpressUrl ? cacheKey : null,\n async () => {\n return queryWordpress(\n ensure(wordpressUrl, \"Wordpress URL must be specified\"),\n ensure(queryType, \"Query Type must be specified\"),\n queryOperator,\n filterValue,\n limit\n );\n }\n );\n\n const hasFilter = queryOperator && filterValue;\n\n if (!queryType) {\n return <div>Please specify query type</div>;\n }\n\n if (queryOperator && !filterValue) {\n return <div>Please specify Filter Value</div>;\n }\n if (!queryOperator && filterValue) {\n return <div>Please specify Query Operator</div>;\n }\n if (hasFilter && data?.length === 0) {\n return <div>No published {queryType} found</div>;\n }\n\n const currentName = `currentWordpress${\n queryType === \"posts\" ? \"Post\" : \"Page\"\n }`;\n const renderedData = noAutoRepeat\n ? children\n : data?.map((item: any, i: number) => (\n <DataProvider key={item.id} name={currentName} data={item}>\n {repeatedElement(i, children)}\n </DataProvider>\n ));\n\n const response = data;\n return (\n <DataProvider data={response} name=\"wordpressItems\">\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\n );\n}\n\ninterface WordpressFieldProps {\n className?: string;\n field?: string;\n setControlContextData?: (data: { data: any }) => void;\n}\nexport const WordpressFieldMeta: ComponentMeta<WordpressFieldProps> = {\n name: \"WordpressField\",\n displayName: \"Wordpress Field\",\n importName: \"WordpressField\",\n importPath: modulePath,\n props: {\n field: {\n type: \"choice\",\n options: [\n \"title\",\n \"slug\",\n \"content\",\n \"excerpt\",\n \"date\",\n \"modified\",\n \"link\",\n \"status\",\n ],\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\nexport function WordpressField({ className, field }: WordpressFieldProps) {\n const currentPost = useSelector(\"currentWordpressPost\");\n const currentPage = useSelector(\"currentWordpressPage\");\n\n const item = currentPost || currentPage;\n\n if (!item) {\n return <div>WordpressField must be used within a WordpressFetcher </div>;\n }\n\n if (!field) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = get(item, field as string);\n\n if (typeof data === \"object\" && \"rendered\" in data) {\n return (\n <div\n className={className}\n style={{ whiteSpace: \"normal\" }}\n dangerouslySetInnerHTML={{ __html: data.rendered }}\n />\n );\n } else if (!data || typeof data === \"object\") {\n return <div className={className}>Please specify a valid field.</div>;\n } else {\n return <div className={className}> {data} </div>;\n }\n}\n", "export const queryOperators = [\n {\n value: \"search\",\n label: \"Search\",\n },\n {\n value: \"slug\",\n label: \"Filter by Slug\",\n },\n {\n value: \"author\",\n label: \"Filter by author\",\n },\n] as const;\n\nexport type QueryOperator = (typeof queryOperators)[number][\"value\"];\n\nexport function ensure<T>(x: T | null | undefined, message?: string): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(message ?? `Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,uBAEA;AACP,OAAO,2BAA2B;;;ACHlC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,OAAO,SAAS;AAChB,OAAO,SAAoB,kBAAkB;;;ACVtC,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAIO,SAAS,OAAU,GAAyB,SAAqB;AACtE,MAAI,MAAM,QAAQ,MAAM,QAAW;AACjC;AACA,UAAM,IAAI,MAAM,4BAAW,qCAAqC;AAAA,EAClE,OAAO;AACL,WAAO;AAAA,EACT;AACF;;;ADXA,IAAM,aAAa;AAMnB,IAAM,qBAAqB,MAAM,cAE/B,MAAS;AAEJ,IAAM,wBACX;AAAA,EACE,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,aAAa;AAAA,MACb,cAAc;AAAA,IAChB;AAAA,EACF;AACF;AAEK,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAAoD;AAClD,SACE,oCAAC,mBAAmB,UAAnB,EAA4B,OAAO,EAAE,aAAa,KAChD,QACH;AAEJ;AAiBO,IAAM,uBAA6D;AAAA,EACxE,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAA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AACvD;",
4
+ "sourcesContent": ["import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n WordpressFetcher,\n WordpressFetcherMeta,\n WordpressField,\n WordpressFieldMeta,\n WordpressProvider,\n WordpressProviderMeta,\n} from \"./wordpress\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n } else {\n registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n }\n\n _registerComponent(WordpressFetcher, WordpressFetcherMeta);\n _registerComponent(WordpressField, WordpressFieldMeta);\n}\n\nexport * from \"./wordpress\";\n", "import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport { queryWordpress } from \"@plasmicpkgs/wordpress\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { ensure, queryOperators, type QueryOperator } from \"./utils\";\n\nconst modulePath = \"@plasmicpkgs/plasmic-wordpress\";\n\ninterface WordpressProviderProps {\n wordpressUrl?: string;\n}\n\nconst CredentialsContext = React.createContext<\n WordpressProviderProps | undefined\n>(undefined);\n\nexport const WordpressProviderMeta: GlobalContextMeta<WordpressProviderProps> =\n {\n name: \"WordpressProvider\",\n displayName: \"Wordpress Provider\",\n description: \"The endpoint of your Wordpress\",\n importName: \"WordpressProvider\",\n importPath: modulePath,\n props: {\n wordpressUrl: {\n type: \"string\",\n displayName: \"Wordpress URL\",\n description: \"URL of your Wordpress \",\n defaultValue: \"https://techcrunch.com/\",\n },\n },\n };\n\nexport function WordpressProvider({\n wordpressUrl,\n children,\n}: React.PropsWithChildren<WordpressProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ wordpressUrl }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface WordpressFetcherProps {\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n queryType?: \"posts\" | \"pages\";\n noAutoRepeat?: boolean;\n limit?: number;\n queryOperator?: QueryOperator;\n filterValue?: string;\n setControlContextData?: (data: {\n posts?: { value: string; label: string }[];\n pages?: { value: string; label: string }[];\n }) => void;\n}\n\nexport const WordpressFetcherMeta: ComponentMeta<WordpressFetcherProps> = {\n name: \"WordpressFetcher\",\n displayName: \"Wordpress Fetcher\",\n importName: \"WordpressFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Wordpress data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gridRowGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"WordpressField\",\n },\n },\n },\n queryType: {\n type: \"choice\",\n options: [\"posts\", \"pages\"],\n },\n queryOperator: {\n type: \"choice\",\n displayName: \"Query Operator\",\n description: \"Filter Parameter filter by\",\n options: () => {\n return queryOperators.map((item: any) => ({\n label: item?.label,\n value: item?.value,\n }));\n },\n hidden: (props) => !props.queryType,\n },\n\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter\",\n hidden: (props) => !props.queryOperator,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit\",\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description:\n \"Do not automatically repeat children for every posts or pages.\",\n defaultValue: false,\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Wordpress Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function WordpressFetcher({\n queryOperator,\n filterValue,\n noAutoRepeat,\n limit,\n queryType,\n children,\n className,\n noLayout,\n}: WordpressFetcherProps) {\n const { wordpressUrl } = ensure(\n useContext(CredentialsContext),\n \"WordpressFetcher must be used within a WordpressProvider\"\n );\n const cacheKey = JSON.stringify({\n queryOperator,\n filterValue,\n limit,\n queryType,\n wordpressUrl,\n });\n\n const { data } = usePlasmicQueryData<any | null>(\n queryType && wordpressUrl ? cacheKey : null,\n async () => {\n return queryWordpress({\n wordpressUrl,\n queryType,\n queryOperator,\n filterValue,\n limit,\n });\n }\n );\n\n const hasFilter = queryOperator && filterValue;\n\n if (!queryType) {\n return <div>Please specify query type</div>;\n }\n\n if (queryOperator && !filterValue) {\n return <div>Please specify Filter Value</div>;\n }\n if (!queryOperator && filterValue) {\n return <div>Please specify Query Operator</div>;\n }\n if (hasFilter && data?.length === 0) {\n return <div>No published {queryType} found</div>;\n }\n\n const currentName = `currentWordpress${\n queryType === \"posts\" ? \"Post\" : \"Page\"\n }`;\n const renderedData = noAutoRepeat\n ? children\n : data?.map((item: any, i: number) => (\n <DataProvider key={item.id} name={currentName} data={item}>\n {repeatedElement(i, children)}\n </DataProvider>\n ));\n\n const response = data;\n return (\n <DataProvider data={response} name=\"wordpressItems\">\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\n );\n}\n\ninterface WordpressFieldProps {\n className?: string;\n field?: string;\n setControlContextData?: (data: { data: any }) => void;\n}\nexport const WordpressFieldMeta: ComponentMeta<WordpressFieldProps> = {\n name: \"WordpressField\",\n displayName: \"Wordpress Field\",\n importName: \"WordpressField\",\n importPath: modulePath,\n props: {\n field: {\n type: \"choice\",\n options: [\n \"title\",\n \"slug\",\n \"content\",\n \"excerpt\",\n \"date\",\n \"modified\",\n \"link\",\n \"status\",\n ],\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\nexport function WordpressField({ className, field }: WordpressFieldProps) {\n const currentPost = useSelector(\"currentWordpressPost\");\n const currentPage = useSelector(\"currentWordpressPage\");\n\n const item = currentPost || currentPage;\n\n if (!item) {\n return <div>WordpressField must be used within a WordpressFetcher </div>;\n }\n\n if (!field) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = get(item, field as string);\n\n if (typeof data === \"object\" && \"rendered\" in data) {\n return (\n <div\n className={className}\n style={{ whiteSpace: \"normal\" }}\n dangerouslySetInnerHTML={{ __html: data.rendered }}\n />\n );\n } else if (!data || typeof data === \"object\") {\n return <div className={className}>Please specify a valid field.</div>;\n } else {\n return <div className={className}> {data} </div>;\n }\n}\n", "export const queryOperators = [\n {\n value: \"search\",\n label: \"Search\",\n },\n {\n value: \"slug\",\n label: \"Filter by Slug\",\n },\n {\n value: \"author\",\n label: \"Filter by author\",\n },\n] as const;\n\nexport type QueryOperator = (typeof queryOperators)[number][\"value\"];\n\nexport function ensure<T>(x: T | null | undefined, message?: string): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(message ?? `Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,uBAEA;AACP,OAAO,2BAA2B;;;ACHlC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,OAAO,SAAS;AAChB,OAAO,SAAoB,kBAAkB;;;ACVtC,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAIO,SAAS,OAAU,GAAyB,SAAqB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,QAC9B,yBAAyB,EAAE,QAAQ,KAAK,SAAS;AAAA;AAAA,IACnD;AAAA,EAEJ,WAAW,CAAC,QAAQ,OAAO,SAAS,UAAU;AAC5C,WAAO,oCAAC,SAAI,aAAsB,+BAA6B;AAAA,EACjE,OAAO;AACL,WAAO,oCAAC,SAAI,aAAsB,KAAE,MAAK,GAAC;AAAA,EAC5C;AACF;;;ADlQO,SAAS,YAAY,QAGzB;AACD,QAAM,qBAAqB,CACzB,WACA,gBACG;AACH,QAAI,QAAQ;AACV,aAAO,kBAAkB,WAAW,WAAW;AAAA,IACjD,OAAO;AACL,wBAAkB,WAAW,WAAW;AAAA,IAC1C;AAAA,EACF;AAEA,MAAI,QAAQ;AACV,WAAO,sBAAsB,mBAAmB,qBAAqB;AAAA,EACvE,OAAO;AACL,0BAAsB,mBAAmB,qBAAqB;AAAA,EAChE;AAEA,qBAAmB,kBAAkB,oBAAoB;AACzD,qBAAmB,gBAAgB,kBAAkB;AACvD;",
6
6
  "names": []
7
7
  }
package/dist/index.js CHANGED
@@ -210,13 +210,13 @@ function WordpressFetcher({
210
210
  const { data } = (0, import_query.usePlasmicQueryData)(
211
211
  queryType && wordpressUrl ? cacheKey : null,
212
212
  () => __async(this, null, function* () {
213
- return (0, import_wordpress.queryWordpress)(
214
- ensure(wordpressUrl, "Wordpress URL must be specified"),
215
- ensure(queryType, "Query Type must be specified"),
213
+ return (0, import_wordpress.queryWordpress)({
214
+ wordpressUrl,
215
+ queryType,
216
216
  queryOperator,
217
217
  filterValue,
218
218
  limit
219
- );
219
+ });
220
220
  })
221
221
  );
222
222
  const hasFilter = queryOperator && filterValue;
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/wordpress.tsx", "../src/utils.ts"],
4
- "sourcesContent": ["import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n WordpressFetcher,\n WordpressFetcherMeta,\n WordpressField,\n WordpressFieldMeta,\n WordpressProvider,\n WordpressProviderMeta,\n} from \"./wordpress\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n } else {\n registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n }\n\n _registerComponent(WordpressFetcher, WordpressFetcherMeta);\n _registerComponent(WordpressField, WordpressFieldMeta);\n}\n\nexport * from \"./wordpress\";\n", "import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport { queryWordpress } from \"@plasmicpkgs/wordpress\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { ensure, queryOperators, type QueryOperator } from \"./utils\";\n\nconst modulePath = \"@plasmicpkgs/plasmic-wordpress\";\n\ninterface WordpressProviderProps {\n wordpressUrl?: string;\n}\n\nconst CredentialsContext = React.createContext<\n WordpressProviderProps | undefined\n>(undefined);\n\nexport const WordpressProviderMeta: GlobalContextMeta<WordpressProviderProps> =\n {\n name: \"WordpressProvider\",\n displayName: \"Wordpress Provider\",\n description: \"The endpoint of your Wordpress\",\n importName: \"WordpressProvider\",\n importPath: modulePath,\n props: {\n wordpressUrl: {\n type: \"string\",\n displayName: \"Wordpress URL\",\n description: \"URL of your Wordpress \",\n defaultValue: \"https://techcrunch.com/\",\n },\n },\n };\n\nexport function WordpressProvider({\n wordpressUrl,\n children,\n}: React.PropsWithChildren<WordpressProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ wordpressUrl }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface WordpressFetcherProps {\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n queryType?: \"posts\" | \"pages\";\n noAutoRepeat?: boolean;\n limit?: number;\n queryOperator?: QueryOperator;\n filterValue?: string;\n setControlContextData?: (data: {\n posts?: { value: string; label: string }[];\n pages?: { value: string; label: string }[];\n }) => void;\n}\n\nexport const WordpressFetcherMeta: ComponentMeta<WordpressFetcherProps> = {\n name: \"WordpressFetcher\",\n displayName: \"Wordpress Fetcher\",\n importName: \"WordpressFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Wordpress data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gridRowGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"WordpressField\",\n },\n },\n },\n queryType: {\n type: \"choice\",\n options: [\"posts\", \"pages\"],\n },\n queryOperator: {\n type: \"choice\",\n displayName: \"Query Operator\",\n description: \"Filter Parameter filter by\",\n options: () => {\n return queryOperators.map((item: any) => ({\n label: item?.label,\n value: item?.value,\n }));\n },\n hidden: (props) => !props.queryType,\n },\n\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter\",\n hidden: (props) => !props.queryOperator,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit\",\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description:\n \"Do not automatically repeat children for every posts or pages.\",\n defaultValue: false,\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Wordpress Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function WordpressFetcher({\n queryOperator,\n filterValue,\n noAutoRepeat,\n limit,\n queryType,\n children,\n className,\n noLayout,\n}: WordpressFetcherProps) {\n const { wordpressUrl } = ensure(\n useContext(CredentialsContext),\n \"WordpressFetcher must be used within a WordpressProvider\"\n );\n const cacheKey = JSON.stringify({\n queryOperator,\n filterValue,\n limit,\n queryType,\n wordpressUrl,\n });\n\n const { data } = usePlasmicQueryData<any | null>(\n queryType && wordpressUrl ? cacheKey : null,\n async () => {\n return queryWordpress(\n ensure(wordpressUrl, \"Wordpress URL must be specified\"),\n ensure(queryType, \"Query Type must be specified\"),\n queryOperator,\n filterValue,\n limit\n );\n }\n );\n\n const hasFilter = queryOperator && filterValue;\n\n if (!queryType) {\n return <div>Please specify query type</div>;\n }\n\n if (queryOperator && !filterValue) {\n return <div>Please specify Filter Value</div>;\n }\n if (!queryOperator && filterValue) {\n return <div>Please specify Query Operator</div>;\n }\n if (hasFilter && data?.length === 0) {\n return <div>No published {queryType} found</div>;\n }\n\n const currentName = `currentWordpress${\n queryType === \"posts\" ? \"Post\" : \"Page\"\n }`;\n const renderedData = noAutoRepeat\n ? children\n : data?.map((item: any, i: number) => (\n <DataProvider key={item.id} name={currentName} data={item}>\n {repeatedElement(i, children)}\n </DataProvider>\n ));\n\n const response = data;\n return (\n <DataProvider data={response} name=\"wordpressItems\">\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\n );\n}\n\ninterface WordpressFieldProps {\n className?: string;\n field?: string;\n setControlContextData?: (data: { data: any }) => void;\n}\nexport const WordpressFieldMeta: ComponentMeta<WordpressFieldProps> = {\n name: \"WordpressField\",\n displayName: \"Wordpress Field\",\n importName: \"WordpressField\",\n importPath: modulePath,\n props: {\n field: {\n type: \"choice\",\n options: [\n \"title\",\n \"slug\",\n \"content\",\n \"excerpt\",\n \"date\",\n \"modified\",\n \"link\",\n \"status\",\n ],\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\nexport function WordpressField({ className, field }: WordpressFieldProps) {\n const currentPost = useSelector(\"currentWordpressPost\");\n const currentPage = useSelector(\"currentWordpressPage\");\n\n const item = currentPost || currentPage;\n\n if (!item) {\n return <div>WordpressField must be used within a WordpressFetcher </div>;\n }\n\n if (!field) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = get(item, field as string);\n\n if (typeof data === \"object\" && \"rendered\" in data) {\n return (\n <div\n className={className}\n style={{ whiteSpace: \"normal\" }}\n dangerouslySetInnerHTML={{ __html: data.rendered }}\n />\n );\n } else if (!data || typeof data === \"object\") {\n return <div className={className}>Please specify a valid field.</div>;\n } else {\n return <div className={className}> {data} </div>;\n }\n}\n", "export const queryOperators = [\n {\n value: \"search\",\n label: \"Search\",\n },\n {\n value: \"slug\",\n label: \"Filter by Slug\",\n },\n {\n value: \"author\",\n label: \"Filter by author\",\n },\n] as const;\n\nexport type QueryOperator = (typeof queryOperators)[number][\"value\"];\n\nexport function ensure<T>(x: T | null | undefined, message?: string): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(message ?? `Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAEO;AACP,mCAAkC;;;ACHlC,kBAMO;AACP,mBAAoC;AACpC,uBAA+B;AAC/B,iBAAgB;AAChB,mBAA6C;;;ACVtC,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAIO,SAAS,OAAU,GAAyB,SAAqB;AACtE,MAAI,MAAM,QAAQ,MAAM,QAAW;AACjC;AACA,UAA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QAAM,WAAO,WAAAC,SAAI,MAAM,KAAe;AAEtC,MAAI,OAAO,SAAS,YAAY,cAAc,MAAM;AAClD,WACE,6BAAAD,QAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,EAAE,YAAY,SAAS;AAAA,QAC9B,yBAAyB,EAAE,QAAQ,KAAK,SAAS;AAAA;AAAA,IACnD;AAAA,EAEJ,WAAW,CAAC,QAAQ,OAAO,SAAS,UAAU;AAC5C,WAAO,6BAAAA,QAAA,cAAC,SAAI,aAAsB,+BAA6B;AAAA,EACjE,OAAO;AACL,WAAO,6BAAAA,QAAA,cAAC,SAAI,aAAsB,KAAE,MAAK,GAAC;AAAA,EAC5C;AACF;;;ADlQO,SAAS,YAAY,QAGzB;AACD,QAAM,qBAAqB,CACzB,WACA,gBACG;AACH,QAAI,QAAQ;AACV,aAAO,kBAAkB,WAAW,WAAW;AAAA,IACjD,OAAO;AACL,mCAAAE,SAAkB,WAAW,WAAW;AAAA,IAC1C;AAAA,EACF;AAEA,MAAI,QAAQ;AACV,WAAO,sBAAsB,mBAAmB,qBAAqB;AAAA,EACvE,OAAO;AACL,qCAAAC,SAAsB,mBAAmB,qBAAqB;AAAA,EAChE;AAEA,qBAAmB,kBAAkB,oBAAoB;AACzD,qBAAmB,gBAAgB,kBAAkB;AACvD;",
4
+ "sourcesContent": ["import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n WordpressFetcher,\n WordpressFetcherMeta,\n WordpressField,\n WordpressFieldMeta,\n WordpressProvider,\n WordpressProviderMeta,\n} from \"./wordpress\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n loader.registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n } else {\n registerGlobalContext(WordpressProvider, WordpressProviderMeta);\n }\n\n _registerComponent(WordpressFetcher, WordpressFetcherMeta);\n _registerComponent(WordpressField, WordpressFieldMeta);\n}\n\nexport * from \"./wordpress\";\n", "import {\n ComponentMeta,\n DataProvider,\n GlobalContextMeta,\n repeatedElement,\n useSelector,\n} from \"@plasmicapp/host\";\nimport { usePlasmicQueryData } from \"@plasmicapp/query\";\nimport { queryWordpress } from \"@plasmicpkgs/wordpress\";\nimport get from \"dlv\";\nimport React, { ReactNode, useContext } from \"react\";\nimport { ensure, queryOperators, type QueryOperator } from \"./utils\";\n\nconst modulePath = \"@plasmicpkgs/plasmic-wordpress\";\n\ninterface WordpressProviderProps {\n wordpressUrl?: string;\n}\n\nconst CredentialsContext = React.createContext<\n WordpressProviderProps | undefined\n>(undefined);\n\nexport const WordpressProviderMeta: GlobalContextMeta<WordpressProviderProps> =\n {\n name: \"WordpressProvider\",\n displayName: \"Wordpress Provider\",\n description: \"The endpoint of your Wordpress\",\n importName: \"WordpressProvider\",\n importPath: modulePath,\n props: {\n wordpressUrl: {\n type: \"string\",\n displayName: \"Wordpress URL\",\n description: \"URL of your Wordpress \",\n defaultValue: \"https://techcrunch.com/\",\n },\n },\n };\n\nexport function WordpressProvider({\n wordpressUrl,\n children,\n}: React.PropsWithChildren<WordpressProviderProps>) {\n return (\n <CredentialsContext.Provider value={{ wordpressUrl }}>\n {children}\n </CredentialsContext.Provider>\n );\n}\n\ninterface WordpressFetcherProps {\n children?: ReactNode;\n className?: string;\n noLayout?: boolean;\n queryType?: \"posts\" | \"pages\";\n noAutoRepeat?: boolean;\n limit?: number;\n queryOperator?: QueryOperator;\n filterValue?: string;\n setControlContextData?: (data: {\n posts?: { value: string; label: string }[];\n pages?: { value: string; label: string }[];\n }) => void;\n}\n\nexport const WordpressFetcherMeta: ComponentMeta<WordpressFetcherProps> = {\n name: \"WordpressFetcher\",\n displayName: \"Wordpress Fetcher\",\n importName: \"WordpressFetcher\",\n importPath: modulePath,\n providesData: true,\n description:\n \"Fetches Wordpress data and repeats content of children once for every row fetched. \",\n defaultStyles: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n gridRowGap: \"8px\",\n padding: \"8px\",\n maxWidth: \"100%\",\n },\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"vbox\",\n styles: {\n padding: \"8px\",\n },\n children: {\n type: \"component\",\n name: \"WordpressField\",\n },\n },\n },\n queryType: {\n type: \"choice\",\n options: [\"posts\", \"pages\"],\n },\n queryOperator: {\n type: \"choice\",\n displayName: \"Query Operator\",\n description: \"Filter Parameter filter by\",\n options: () => {\n return queryOperators.map((item: any) => ({\n label: item?.label,\n value: item?.value,\n }));\n },\n hidden: (props) => !props.queryType,\n },\n\n filterValue: {\n type: \"string\",\n displayName: \"Filter value\",\n description: \"Value to filter\",\n hidden: (props) => !props.queryOperator,\n },\n limit: {\n type: \"number\",\n displayName: \"Limit\",\n description: \"Limit\",\n },\n noAutoRepeat: {\n type: \"boolean\",\n displayName: \"No auto-repeat\",\n description:\n \"Do not automatically repeat children for every posts or pages.\",\n defaultValue: false,\n },\n noLayout: {\n type: \"boolean\",\n displayName: \"No layout\",\n description:\n \"When set, Wordpress Fetcher will not layout its children; instead, the layout set on its parent element will be used. Useful if you want to set flex gap or control container tag type.\",\n defaultValue: false,\n },\n },\n};\n\nexport function WordpressFetcher({\n queryOperator,\n filterValue,\n noAutoRepeat,\n limit,\n queryType,\n children,\n className,\n noLayout,\n}: WordpressFetcherProps) {\n const { wordpressUrl } = ensure(\n useContext(CredentialsContext),\n \"WordpressFetcher must be used within a WordpressProvider\"\n );\n const cacheKey = JSON.stringify({\n queryOperator,\n filterValue,\n limit,\n queryType,\n wordpressUrl,\n });\n\n const { data } = usePlasmicQueryData<any | null>(\n queryType && wordpressUrl ? cacheKey : null,\n async () => {\n return queryWordpress({\n wordpressUrl,\n queryType,\n queryOperator,\n filterValue,\n limit,\n });\n }\n );\n\n const hasFilter = queryOperator && filterValue;\n\n if (!queryType) {\n return <div>Please specify query type</div>;\n }\n\n if (queryOperator && !filterValue) {\n return <div>Please specify Filter Value</div>;\n }\n if (!queryOperator && filterValue) {\n return <div>Please specify Query Operator</div>;\n }\n if (hasFilter && data?.length === 0) {\n return <div>No published {queryType} found</div>;\n }\n\n const currentName = `currentWordpress${\n queryType === \"posts\" ? \"Post\" : \"Page\"\n }`;\n const renderedData = noAutoRepeat\n ? children\n : data?.map((item: any, i: number) => (\n <DataProvider key={item.id} name={currentName} data={item}>\n {repeatedElement(i, children)}\n </DataProvider>\n ));\n\n const response = data;\n return (\n <DataProvider data={response} name=\"wordpressItems\">\n {noLayout ? (\n <> {renderedData} </>\n ) : (\n <div className={className}> {renderedData} </div>\n )}\n </DataProvider>\n );\n}\n\ninterface WordpressFieldProps {\n className?: string;\n field?: string;\n setControlContextData?: (data: { data: any }) => void;\n}\nexport const WordpressFieldMeta: ComponentMeta<WordpressFieldProps> = {\n name: \"WordpressField\",\n displayName: \"Wordpress Field\",\n importName: \"WordpressField\",\n importPath: modulePath,\n props: {\n field: {\n type: \"choice\",\n options: [\n \"title\",\n \"slug\",\n \"content\",\n \"excerpt\",\n \"date\",\n \"modified\",\n \"link\",\n \"status\",\n ],\n displayName: \"Field\",\n description: \"Field to be displayed.\",\n },\n },\n};\nexport function WordpressField({ className, field }: WordpressFieldProps) {\n const currentPost = useSelector(\"currentWordpressPost\");\n const currentPage = useSelector(\"currentWordpressPage\");\n\n const item = currentPost || currentPage;\n\n if (!item) {\n return <div>WordpressField must be used within a WordpressFetcher </div>;\n }\n\n if (!field) {\n return <div>Please specify a valid path or select a field.</div>;\n }\n\n const data = get(item, field as string);\n\n if (typeof data === \"object\" && \"rendered\" in data) {\n return (\n <div\n className={className}\n style={{ whiteSpace: \"normal\" }}\n dangerouslySetInnerHTML={{ __html: data.rendered }}\n />\n );\n } else if (!data || typeof data === \"object\") {\n return <div className={className}>Please specify a valid field.</div>;\n } else {\n return <div className={className}> {data} </div>;\n }\n}\n", "export const queryOperators = [\n {\n value: \"search\",\n label: \"Search\",\n },\n {\n value: \"slug\",\n label: \"Filter by Slug\",\n },\n {\n value: \"author\",\n label: \"Filter by author\",\n },\n] as const;\n\nexport type QueryOperator = (typeof queryOperators)[number][\"value\"];\n\nexport function ensure<T>(x: T | null | undefined, message?: string): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(message ?? `Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAEO;AACP,mCAAkC;;;ACHlC,kBAMO;AACP,mBAAoC;AACpC,uBAA+B;AAC/B,iBAAgB;AAChB,mBAA6C;;;ACVtC,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAIO,SAAS,OAAU,GAAyB,SAAqB;AACtE,MAAI,MAAM,QAAQ,MAAM,QAAW;AACjC;AACA,UAAM,IAAI,MAAM,4BAAW,qCAAqC;AAAA,EAClE,OAAO;AACL,WAAO;AAAA,EACT;AACF;;;ADXA,IAAM,aAAa;AAMnB,IAAM,qBAAqB,aAAAA,QAAM,cAE/B,MAAS;AAEJ,IAAM,wBACX;AAAA,EACE,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,aAAa;AAAA,MACb,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AA,QAAA,cAAC,SAAI,aAAsB,KAAE,MAAK,GAAC;AAAA,EAC5C;AACF;;;ADlQO,SAAS,YAAY,QAGzB;AACD,QAAM,qBAAqB,CACzB,WACA,gBACG;AACH,QAAI,QAAQ;AACV,aAAO,kBAAkB,WAAW,WAAW;AAAA,IACjD,OAAO;AACL,mCAAAE,SAAkB,WAAW,WAAW;AAAA,IAC1C;AAAA,EACF;AAEA,MAAI,QAAQ;AACV,WAAO,sBAAsB,mBAAmB,qBAAqB;AAAA,EACvE,OAAO;AACL,qCAAAC,SAAsB,mBAAmB,qBAAqB;AAAA,EAChE;AAEA,qBAAmB,kBAAkB,oBAAoB;AACzD,qBAAmB,gBAAgB,kBAAkB;AACvD;",
6
6
  "names": ["React", "get", "registerComponent", "registerGlobalContext"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/plasmic-wordpress",
3
- "version": "0.0.156",
3
+ "version": "0.0.157",
4
4
  "description": "Plasmic Wordpress components.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -44,9 +44,9 @@
44
44
  }
45
45
  ],
46
46
  "devDependencies": {
47
- "@plasmicapp/host": "1.0.231",
47
+ "@plasmicapp/host": "1.0.232",
48
48
  "@plasmicapp/query": "0.1.81",
49
- "@plasmicpkgs/wordpress": "0.0.7",
49
+ "@plasmicpkgs/wordpress": "0.0.8",
50
50
  "@types/react": "^18.0.27",
51
51
  "@types/react-dom": "^18.0.10",
52
52
  "husky": "^7.0.4",
@@ -57,5 +57,5 @@
57
57
  "@types/dlv": "^1.1.2",
58
58
  "dlv": "^1.1.3"
59
59
  },
60
- "gitHead": "6b9428c7b4f35d9b84241981523e746e18e2abb7"
60
+ "gitHead": "b6552bed8840c583a74ba7e1c724fa2850c6c2ed"
61
61
  }