gatsby-attainlabs-cms 1.0.6 → 1.0.8
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.d.ts +9 -0
- package/dist/index.js +8 -0
- package/{gatsby-node.js → gatsby-node.ts} +2 -2
- package/package.json +10 -4
- package/src/index.ts +18 -0
- package/tsconfig.json +15 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SliceComponentProps } from "gatsby";
|
|
3
|
+
interface SliceWrapperProps extends SliceComponentProps {
|
|
4
|
+
sliceContext: {
|
|
5
|
+
componentPath: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare function SliceWrapper({ sliceContext }: SliceWrapperProps): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
9
|
+
export { SliceWrapper };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
function SliceWrapper({ sliceContext }) {
|
|
3
|
+
const { componentPath, ...props } = sliceContext;
|
|
4
|
+
// Dynamically import your component
|
|
5
|
+
const Component = require(componentPath).default;
|
|
6
|
+
return React.createElement(Component, props);
|
|
7
|
+
}
|
|
8
|
+
export { SliceWrapper };
|
|
@@ -48,12 +48,12 @@ export const onPreInit = async (_, pluginOptions) => {
|
|
|
48
48
|
const targets = [
|
|
49
49
|
{
|
|
50
50
|
repoPath: `/apps/cms/src/cms/components/editor/visual-block-editor/components/brands/${brands[brand]}`,
|
|
51
|
-
localBasePath: path.resolve("./src/cms/components/
|
|
51
|
+
localBasePath: path.resolve("./src/cms/components/"),
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
repoPath:
|
|
55
55
|
"/apps/cms/src/cms/components/editor/visual-block-editor/components/global/blocks",
|
|
56
|
-
localBasePath: path.resolve("./src/cms/components/
|
|
56
|
+
localBasePath: path.resolve("./src/cms/components/"),
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
repoPath: `/apps/cms/src/gatsby-plugin-theme-ui/${brands[brand]}`,
|
package/package.json
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-attainlabs-cms",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
5
7
|
"type": "module",
|
|
6
8
|
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"build": "tsc"
|
|
8
11
|
},
|
|
9
12
|
"author": "Anthony Barrera",
|
|
10
13
|
"license": "ISC",
|
|
11
|
-
"description": "A Gatsby plugin that downloads and syncs
|
|
14
|
+
"description": "A Gatsby plugin that downloads and syncs components from the **Attain Labs CMS** hosted in Azure Repos into your Gatsby project at build time.",
|
|
12
15
|
"peerDependencies": {
|
|
13
16
|
"gatsby": "^5.0.0 || ^4.0.0"
|
|
14
17
|
},
|
|
15
18
|
"dependencies": {
|
|
16
19
|
"dotenv": "^17.2.1",
|
|
17
20
|
"react-slick": "^0.31.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.9.2"
|
|
18
24
|
}
|
|
19
25
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SliceComponentProps } from "gatsby";
|
|
3
|
+
|
|
4
|
+
interface SliceWrapperProps extends SliceComponentProps {
|
|
5
|
+
sliceContext: {
|
|
6
|
+
componentPath: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function SliceWrapper({ sliceContext }: SliceWrapperProps) {
|
|
11
|
+
const { componentPath, ...props } = sliceContext;
|
|
12
|
+
|
|
13
|
+
// Dynamically import your component
|
|
14
|
+
const Component = require(componentPath).default;
|
|
15
|
+
return React.createElement(Component, props);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { SliceWrapper };
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"skipLibCheck": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"],
|
|
14
|
+
"exclude": ["dist"]
|
|
15
|
+
}
|