strapi-plugin-ai-sdk 0.6.0 → 0.6.2

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.
@@ -6,7 +6,7 @@ const reactRouterDom = require("react-router-dom");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const react = require("react");
8
8
  const styled = require("styled-components");
9
- const index = require("./index-BjecrblN.js");
9
+ const index = require("./index-BCq8Gjnl.js");
10
10
  const THREE = require("three");
11
11
  const OrbitControls_js = require("three/examples/jsm/controls/OrbitControls.js");
12
12
  const GLTFLoader_js = require("three/examples/jsm/loaders/GLTFLoader.js");
@@ -2700,6 +2700,50 @@ function WidgetPreviewPage() {
2700
2700
  ),
2701
2701
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleCopy, children: copied ? "Copied!" : "Copy Snippet" }) })
2702
2702
  ] }),
2703
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginTop: 6, padding: 6, background: "neutral0", shadow: "filterShadow", hasRadius: true, children: [
2704
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: "Production Setup" }),
2705
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "omega", textColor: "neutral600", tag: "p", style: { marginTop: "8px" }, children: [
2706
+ "If the widget is embedded on a different domain, update your Strapi project's",
2707
+ " ",
2708
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "config/middlewares.ts" }),
2709
+ " to allow cross-origin access:"
2710
+ ] }),
2711
+ /* @__PURE__ */ jsxRuntime.jsx(
2712
+ designSystem.Box,
2713
+ {
2714
+ marginTop: 4,
2715
+ padding: 4,
2716
+ background: "neutral100",
2717
+ hasRadius: true,
2718
+ style: { fontFamily: "monospace", fontSize: "13px", whiteSpace: "pre", overflowX: "auto", lineHeight: "1.5" },
2719
+ children: `// config/middlewares.ts
2720
+ {
2721
+ name: 'strapi::security',
2722
+ config: {
2723
+ contentSecurityPolicy: {
2724
+ directives: {
2725
+ 'script-src': ["'self'", "'unsafe-inline'"],
2726
+ 'connect-src': ["'self'", "blob:"],
2727
+ 'img-src': ["'self'", "data:", "blob:"],
2728
+ 'frame-ancestors': ["'self'", "https://your-frontend.com"],
2729
+ },
2730
+ },
2731
+ },
2732
+ },
2733
+ {
2734
+ name: 'strapi::cors',
2735
+ config: {
2736
+ origin: ['https://your-frontend.com'],
2737
+ },
2738
+ },`
2739
+ }
2740
+ ),
2741
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral500", tag: "p", style: { marginTop: "8px" }, children: [
2742
+ "Replace ",
2743
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "https://your-frontend.com" }),
2744
+ " with the domain(s) where the widget will be embedded."
2745
+ ] })
2746
+ ] }),
2703
2747
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginTop: 6, padding: 6, background: "neutral0", shadow: "filterShadow", hasRadius: true, children: [
2704
2748
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h2", children: "Development" }),
2705
2749
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", tag: "p", style: { marginTop: "8px" }, children: "To live-reload the widget during development, run:" }),
@@ -4,7 +4,7 @@ import { Link, useNavigate, Routes, Route } from "react-router-dom";
4
4
  import { Box, Typography, TextInput, Button, Main, SearchForm, Searchbar, Table, Thead, Tr, Th, Tbody, Td, Flex, Pagination, Modal, Field, Textarea, SingleSelect, SingleSelectOption } from "@strapi/design-system";
5
5
  import { useState, useEffect, useCallback, useRef, createContext, useContext, forwardRef, useMemo } from "react";
6
6
  import styled from "styled-components";
7
- import { P as PLUGIN_ID } from "./index-Ba2NvTWa.mjs";
7
+ import { P as PLUGIN_ID } from "./index-DNcK7AKT.mjs";
8
8
  import * as THREE from "three";
9
9
  import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
10
10
  import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
@@ -2677,6 +2677,50 @@ function WidgetPreviewPage() {
2677
2677
  ),
2678
2678
  /* @__PURE__ */ jsx(Flex, { marginTop: 4, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleCopy, children: copied ? "Copied!" : "Copy Snippet" }) })
2679
2679
  ] }),
2680
+ /* @__PURE__ */ jsxs(Box, { marginTop: 6, padding: 6, background: "neutral0", shadow: "filterShadow", hasRadius: true, children: [
2681
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", children: "Production Setup" }),
2682
+ /* @__PURE__ */ jsxs(Typography, { variant: "omega", textColor: "neutral600", tag: "p", style: { marginTop: "8px" }, children: [
2683
+ "If the widget is embedded on a different domain, update your Strapi project's",
2684
+ " ",
2685
+ /* @__PURE__ */ jsx("strong", { children: "config/middlewares.ts" }),
2686
+ " to allow cross-origin access:"
2687
+ ] }),
2688
+ /* @__PURE__ */ jsx(
2689
+ Box,
2690
+ {
2691
+ marginTop: 4,
2692
+ padding: 4,
2693
+ background: "neutral100",
2694
+ hasRadius: true,
2695
+ style: { fontFamily: "monospace", fontSize: "13px", whiteSpace: "pre", overflowX: "auto", lineHeight: "1.5" },
2696
+ children: `// config/middlewares.ts
2697
+ {
2698
+ name: 'strapi::security',
2699
+ config: {
2700
+ contentSecurityPolicy: {
2701
+ directives: {
2702
+ 'script-src': ["'self'", "'unsafe-inline'"],
2703
+ 'connect-src': ["'self'", "blob:"],
2704
+ 'img-src': ["'self'", "data:", "blob:"],
2705
+ 'frame-ancestors': ["'self'", "https://your-frontend.com"],
2706
+ },
2707
+ },
2708
+ },
2709
+ },
2710
+ {
2711
+ name: 'strapi::cors',
2712
+ config: {
2713
+ origin: ['https://your-frontend.com'],
2714
+ },
2715
+ },`
2716
+ }
2717
+ ),
2718
+ /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral500", tag: "p", style: { marginTop: "8px" }, children: [
2719
+ "Replace ",
2720
+ /* @__PURE__ */ jsx("strong", { children: "https://your-frontend.com" }),
2721
+ " with the domain(s) where the widget will be embedded."
2722
+ ] })
2723
+ ] }),
2680
2724
  /* @__PURE__ */ jsxs(Box, { marginTop: 6, padding: 6, background: "neutral0", shadow: "filterShadow", hasRadius: true, children: [
2681
2725
  /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", children: "Development" }),
2682
2726
  /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", tag: "p", style: { marginTop: "8px" }, children: "To live-reload the widget during development, run:" }),
@@ -37,7 +37,7 @@ const index = {
37
37
  defaultMessage: PLUGIN_ID
38
38
  },
39
39
  Component: async () => {
40
- const { App } = await Promise.resolve().then(() => require("./App-DRve2JNH.js"));
40
+ const { App } = await Promise.resolve().then(() => require("./App-BcZSDAZc.js"));
41
41
  return App;
42
42
  }
43
43
  });
@@ -36,7 +36,7 @@ const index = {
36
36
  defaultMessage: PLUGIN_ID
37
37
  },
38
38
  Component: async () => {
39
- const { App } = await import("./App-DeTHIZY1.mjs");
39
+ const { App } = await import("./App-tiKFYaQx.mjs");
40
40
  return App;
41
41
  }
42
42
  });
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BjecrblN.js");
2
+ const index = require("../_chunks/index-BCq8Gjnl.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-Ba2NvTWa.mjs";
1
+ import { i } from "../_chunks/index-DNcK7AKT.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.0",
2
+ "version": "0.6.2",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "strapi-plugin",