@webiny/ai-powerups 6.6.0-alpha.8 → 6.6.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const CmsEntryWizardGate: (() => React.JSX.Element) & React.NamedExoticComponent<unknown> & {
|
|
3
|
-
readonly type: () => React.JSX.Element;
|
|
2
|
+
export declare const CmsEntryWizardGate: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
3
|
+
readonly type: () => React.JSX.Element | null;
|
|
4
4
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import react, { useEffect } from "react";
|
|
2
2
|
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { useFeatureFlags } from "@webiny/app-admin";
|
|
3
4
|
import { useModel } from "@webiny/app-headless-cms/admin/components/ModelProvider/useModel.js";
|
|
4
5
|
import { useContentEntryFormPresenter } from "@webiny/app-headless-cms/exports/admin/cms/entry/editor.js";
|
|
5
6
|
import { CmsEntryWizard } from "./CmsEntryWizard.js";
|
|
6
7
|
const CmsEntryWizardGate = observer(()=>{
|
|
8
|
+
const featureFlags = useFeatureFlags();
|
|
7
9
|
const { model } = useModel();
|
|
8
10
|
const formPresenter = useContentEntryFormPresenter();
|
|
9
|
-
const showWizard = model.settings?.aiEntryWizard === true;
|
|
11
|
+
const showWizard = model.settings?.aiEntryWizard === true && featureFlags.isEnabled("aiPowerups.cms.entryGeneration");
|
|
10
12
|
useEffect(()=>{
|
|
11
13
|
if (!showWizard) formPresenter.newEntry();
|
|
12
14
|
}, [
|
|
13
15
|
showWizard
|
|
14
16
|
]);
|
|
17
|
+
if (!showWizard) return null;
|
|
15
18
|
return /*#__PURE__*/ react.createElement(CmsEntryWizard, null);
|
|
16
19
|
});
|
|
17
20
|
export { CmsEntryWizardGate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js","sources":["../../../../src/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useModel } from \"@webiny/app-headless-cms/admin/components/ModelProvider/useModel.js\";\nimport { useContentEntryFormPresenter } from \"@webiny/app-headless-cms/exports/admin/cms/entry/editor.js\";\nimport { CmsEntryWizard } from \"./CmsEntryWizard.js\";\n\nexport const CmsEntryWizardGate = observer(() => {\n const { model } = useModel();\n const formPresenter = useContentEntryFormPresenter();\n\n const showWizard
|
|
1
|
+
{"version":3,"file":"admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js","sources":["../../../../src/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useFeatureFlags } from \"@webiny/app-admin\";\nimport { useModel } from \"@webiny/app-headless-cms/admin/components/ModelProvider/useModel.js\";\nimport { useContentEntryFormPresenter } from \"@webiny/app-headless-cms/exports/admin/cms/entry/editor.js\";\nimport { CmsEntryWizard } from \"./CmsEntryWizard.js\";\n\nexport const CmsEntryWizardGate = observer(() => {\n const featureFlags = useFeatureFlags();\n const { model } = useModel();\n const formPresenter = useContentEntryFormPresenter();\n\n /**\n * The AI wizard depends on the CMS content generation feature, which is only registered\n * when AI entry generation is enabled.\n */\n const showWizard =\n model.settings?.aiEntryWizard === true &&\n featureFlags.isEnabled(\"aiPowerups.cms.entryGeneration\");\n\n useEffect(() => {\n if (!showWizard) {\n formPresenter.newEntry();\n }\n }, [showWizard]);\n\n if (!showWizard) {\n return null;\n }\n\n return <CmsEntryWizard />;\n});\n"],"names":["CmsEntryWizardGate","observer","featureFlags","useFeatureFlags","model","useModel","formPresenter","useContentEntryFormPresenter","showWizard","useEffect","CmsEntryWizard"],"mappings":";;;;;;AAOO,MAAMA,qBAAqBC,SAAS;IACvC,MAAMC,eAAeC;IACrB,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClB,MAAMC,gBAAgBC;IAMtB,MAAMC,aACFJ,MAAM,QAAQ,EAAE,kBAAkB,QAClCF,aAAa,SAAS,CAAC;IAE3BO,UAAU;QACN,IAAI,CAACD,YACDF,cAAc,QAAQ;IAE9B,GAAG;QAACE;KAAW;IAEf,IAAI,CAACA,YACD,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACE,gBAAcA;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/ai-powerups",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -18,26 +18,26 @@
|
|
|
18
18
|
"author": "Webiny Ltd.",
|
|
19
19
|
"license": "Webiny Enterprise",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@webiny/admin-ui": "6.6.0-alpha.
|
|
22
|
-
"@webiny/api-core": "6.6.0-alpha.
|
|
23
|
-
"@webiny/api-file-manager": "6.6.0-alpha.
|
|
24
|
-
"@webiny/api-headless-cms": "6.6.0-alpha.
|
|
25
|
-
"@webiny/api-website-builder": "6.6.0-alpha.
|
|
26
|
-
"@webiny/api-websockets": "6.6.0-alpha.
|
|
27
|
-
"@webiny/app": "6.6.0-alpha.
|
|
28
|
-
"@webiny/app-admin": "6.6.0-alpha.
|
|
29
|
-
"@webiny/app-headless-cms": "6.6.0-alpha.
|
|
30
|
-
"@webiny/app-website-builder": "6.6.0-alpha.
|
|
31
|
-
"@webiny/app-websockets": "6.6.0-alpha.
|
|
32
|
-
"@webiny/background-tasks": "6.6.0-alpha.
|
|
21
|
+
"@webiny/admin-ui": "6.6.0-alpha.9",
|
|
22
|
+
"@webiny/api-core": "6.6.0-alpha.9",
|
|
23
|
+
"@webiny/api-file-manager": "6.6.0-alpha.9",
|
|
24
|
+
"@webiny/api-headless-cms": "6.6.0-alpha.9",
|
|
25
|
+
"@webiny/api-website-builder": "6.6.0-alpha.9",
|
|
26
|
+
"@webiny/api-websockets": "6.6.0-alpha.9",
|
|
27
|
+
"@webiny/app": "6.6.0-alpha.9",
|
|
28
|
+
"@webiny/app-admin": "6.6.0-alpha.9",
|
|
29
|
+
"@webiny/app-headless-cms": "6.6.0-alpha.9",
|
|
30
|
+
"@webiny/app-website-builder": "6.6.0-alpha.9",
|
|
31
|
+
"@webiny/app-websockets": "6.6.0-alpha.9",
|
|
32
|
+
"@webiny/background-tasks": "6.6.0-alpha.9",
|
|
33
33
|
"@webiny/di": "1.1.0",
|
|
34
|
-
"@webiny/event-handler-core": "6.6.0-alpha.
|
|
35
|
-
"@webiny/feature": "6.6.0-alpha.
|
|
36
|
-
"@webiny/icons": "6.6.0-alpha.
|
|
37
|
-
"@webiny/languages": "6.6.0-alpha.
|
|
38
|
-
"@webiny/lexical-converter": "6.6.0-alpha.
|
|
39
|
-
"@webiny/project-aws": "6.6.0-alpha.
|
|
40
|
-
"@webiny/utils": "6.6.0-alpha.
|
|
34
|
+
"@webiny/event-handler-core": "6.6.0-alpha.9",
|
|
35
|
+
"@webiny/feature": "6.6.0-alpha.9",
|
|
36
|
+
"@webiny/icons": "6.6.0-alpha.9",
|
|
37
|
+
"@webiny/languages": "6.6.0-alpha.9",
|
|
38
|
+
"@webiny/lexical-converter": "6.6.0-alpha.9",
|
|
39
|
+
"@webiny/project-aws": "6.6.0-alpha.9",
|
|
40
|
+
"@webiny/utils": "6.6.0-alpha.9",
|
|
41
41
|
"ai": "7.0.73",
|
|
42
42
|
"front-matter": "4.0.2",
|
|
43
43
|
"happy-dom": "20.11.6",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"zod": "4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@webiny/api-graphql": "6.6.0-alpha.
|
|
53
|
-
"@webiny/build-tools": "6.6.0-alpha.
|
|
54
|
-
"@webiny/feature-flags": "6.6.0-alpha.
|
|
55
|
-
"@webiny/wcp": "6.6.0-alpha.
|
|
52
|
+
"@webiny/api-graphql": "6.6.0-alpha.9",
|
|
53
|
+
"@webiny/build-tools": "6.6.0-alpha.9",
|
|
54
|
+
"@webiny/feature-flags": "6.6.0-alpha.9",
|
|
55
|
+
"@webiny/wcp": "6.6.0-alpha.9",
|
|
56
56
|
"rimraf": "6.1.3",
|
|
57
57
|
"typescript": "7.0.2",
|
|
58
58
|
"vitest": "4.1.11"
|