intlayer-editor 7.5.0 → 7.5.2-canary.0

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,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue-BQglRdBF.js","assets/css-BtVcDqlU.js","assets/javascript-DLs729Nk.js","assets/typescript-Cju7JbYj.js","assets/json-D07AUpjp.js","assets/html-derivative-Cswrtqyq.js","assets/html-BOjX3v2Q.js","assets/bundle-web-Bm391V69.js","assets/index-0ibbfhRF.js","assets/index-xMTI_9fM.css"])))=>i.map(i=>d[i]);
2
- import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-0ibbfhRF.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue-BQglRdBF.js","assets/css-BtVcDqlU.js","assets/javascript-DLs729Nk.js","assets/typescript-Cju7JbYj.js","assets/json-D07AUpjp.js","assets/html-derivative-Cswrtqyq.js","assets/html-BOjX3v2Q.js","assets/bundle-web-C9Jzokqt.js","assets/index-CVWuS5bN.js","assets/index-xMTI_9fM.css"])))=>i.map(i=>d[i]);
2
+ import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-CVWuS5bN.js";
3
3
  const languageCache = /* @__PURE__ */ new Map();
4
4
  const themeCache = /* @__PURE__ */ new Map();
5
5
  const loadLanguage = async (lang) => {
@@ -60,7 +60,7 @@ const loadTheme = async (themeName) => {
60
60
  const highlightCode = async (code, lang, isDarkMode) => {
61
61
  const themeName = isDarkMode ? "github-dark" : "github-light";
62
62
  const [{ codeToHtml }, languageModule, themeModule] = await Promise.all([
63
- __vitePreload(() => import("./bundle-web-Bm391V69.js"), true ? __vite__mapDeps([7,8,9]) : void 0),
63
+ __vitePreload(() => import("./bundle-web-C9Jzokqt.js"), true ? __vite__mapDeps([7,8,9]) : void 0),
64
64
  loadLanguage(lang),
65
65
  loadTheme(themeName)
66
66
  ]);
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-ChYFFmg7.js","assets/html-BOjX3v2Q.js","assets/javascript-DLs729Nk.js","assets/css-BtVcDqlU.js","assets/angular-ts-CpuGw9DZ.js","assets/scss-Dq-LbI_c.js","assets/astro-B0lt4qz0.js","assets/json-D07AUpjp.js","assets/typescript-Cju7JbYj.js","assets/postcss-kj1IbjVd.js","assets/tsx-B9RA6cgQ.js","assets/blade-DtOFwYfC.js","assets/html-derivative-Cswrtqyq.js","assets/xml-BMzZeaqs.js","assets/java-BfXh-0uJ.js","assets/sql-DzUuSofg.js","assets/coffee-DJkIX6_2.js","assets/cpp-zh2ePAE_.js","assets/regexp-BxWeO75u.js","assets/glsl-CGsiYPcu.js","assets/c-C4VtT7JA.js","assets/graphql-oNSp8dGZ.js","assets/jsx-BPmvoin2.js","assets/haml-BJ44RGT2.js","assets/handlebars-DTnHNTeU.js","assets/yaml-B_vW5iTY.js","assets/http-B1QlEqj7.js","assets/bash-Bz2gZrDc.js","assets/hurl-Br_hZn4E.js","assets/csv-Ba84L8e5.js","assets/jinja-BAZ4h1JD.js","assets/jison-Bwp1bXaL.js","assets/julia-D0f5tMoo.js","assets/python-CrdIx4PZ.js","assets/r-oprfD2-9.js","assets/marko-rwefYVra.js","assets/less-BAzLMJNR.js","assets/mdc-ucHOH9Vl.js","assets/markdown-F_EULe_G.js","assets/php-CI-6KGJr.js","assets/pug-C-LeC0-n.js","assets/svelte-CYSO_rLN.js","assets/ts-tags-DCkNjov3.js","assets/vue-BQglRdBF.js","assets/vue-html-BS551n9F.js","assets/vue-vine-B43RKH9N.js","assets/stylus-DXFa_2Jl.js"])))=>i.map(i=>d[i]);
2
- import { _ as __vitePreload } from "./index-0ibbfhRF.js";
2
+ import { _ as __vitePreload } from "./index-CVWuS5bN.js";
3
3
  let ShikiError$2 = class ShikiError extends Error {
4
4
  constructor(message) {
5
5
  super(message);
@@ -14584,25 +14584,31 @@ const cacheKey = (locales, options) => JSON.stringify([locales, options]);
14584
14584
  const createCachedConstructor = (Ctor) => {
14585
14585
  const cache = /* @__PURE__ */ new Map();
14586
14586
  function Wrapped(locales, options) {
14587
- if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") throw new Error([
14588
- `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
14589
- `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
14590
- ``,
14591
- `import 'intl';`,
14592
- `import '@formatjs/intl-getcanonicallocales/polyfill';`,
14593
- `import '@formatjs/intl-locale/polyfill';`,
14594
- `import '@formatjs/intl-pluralrules/polyfill';`,
14595
- `import '@formatjs/intl-displaynames/polyfill';`,
14596
- `import '@formatjs/intl-listformat/polyfill';`,
14597
- `import '@formatjs/intl-numberformat/polyfill';`,
14598
- `import '@formatjs/intl-relativetimeformat/polyfill';`,
14599
- `import '@formatjs/intl-datetimeformat/polyfill';`,
14600
- ``,
14601
- `// Optionally add locale data`,
14602
- `import '@formatjs/intl-pluralrules/locale-data/fr';`,
14603
- `import '@formatjs/intl-numberformat/locale-data/fr';`,
14604
- `import '@formatjs/intl-datetimeformat/locale-data/fr';`
14605
- ].join("\n"));
14587
+ if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") {
14588
+ {
14589
+ const message = [
14590
+ `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
14591
+ `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
14592
+ ``,
14593
+ `import 'intl';`,
14594
+ `import '@formatjs/intl-displaynames/polyfill';`,
14595
+ `import '@formatjs/intl-getcanonicallocales/polyfill';`,
14596
+ `import '@formatjs/intl-locale/polyfill';`,
14597
+ `import '@formatjs/intl-pluralrules/polyfill';`,
14598
+ `import '@formatjs/intl-listformat/polyfill';`,
14599
+ `import '@formatjs/intl-numberformat/polyfill';`,
14600
+ `import '@formatjs/intl-relativetimeformat/polyfill';`,
14601
+ `import '@formatjs/intl-datetimeformat/polyfill';`,
14602
+ ``,
14603
+ `// Optionally add locale data`,
14604
+ `import '@formatjs/intl-pluralrules/locale-data/fr';`,
14605
+ `import '@formatjs/intl-numberformat/locale-data/fr';`,
14606
+ `import '@formatjs/intl-datetimeformat/locale-data/fr';`
14607
+ ].join("\n");
14608
+ console.warn(message);
14609
+ throw new Error(message);
14610
+ }
14611
+ }
14606
14612
  const key2 = cacheKey(locales ?? locales_exports.ENGLISH, options);
14607
14613
  let instance = cache.get(key2);
14608
14614
  if (!instance) {
@@ -24427,7 +24433,7 @@ function B({ asChild: r2, children: o2 }, n2) {
24427
24433
  }
24428
24434
  var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
24429
24435
  const CommandRoot = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e, {
24430
- className: cn$2("flex size-full flex-col overflow-hidden rounded-md", className),
24436
+ className: cn$2("flex flex-col overflow-hidden rounded-md", className),
24431
24437
  ...props
24432
24438
  });
24433
24439
  const CommandInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
@@ -40075,7 +40081,14 @@ const getAuthAPI = (intlayerConfig) => {
40075
40081
  return client2.signIn.magicLink(...args);
40076
40082
  };
40077
40083
  const signInSSO = async (...args) => {
40078
- return client2.sso.signIn(...args);
40084
+ return client2.signIn.sso(...args);
40085
+ };
40086
+ const registerSSO = async (...args) => {
40087
+ return client2.sso.register(...args);
40088
+ };
40089
+ const listSSOProviders = async () => {
40090
+ };
40091
+ const deleteSSOProvider = async (args) => {
40079
40092
  };
40080
40093
  return {
40081
40094
  getAuthClient: () => client2,
@@ -40112,7 +40125,10 @@ const getAuthAPI = (intlayerConfig) => {
40112
40125
  deletePasskey,
40113
40126
  listPasskeys,
40114
40127
  signInMagicLink,
40115
- signInSSO
40128
+ signInSSO,
40129
+ registerSSO,
40130
+ listSSOProviders,
40131
+ deleteSSOProvider
40116
40132
  };
40117
40133
  };
40118
40134
  function useSession(sessionProp, intlayerConfiguration) {
@@ -44324,16 +44340,25 @@ let SwitchSelectorColor = /* @__PURE__ */ (function(SwitchSelectorColor$1) {
44324
44340
  return SwitchSelectorColor$1;
44325
44341
  })({});
44326
44342
  const switchSelectorVariant = cva("flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]", {
44327
- variants: { color: {
44328
- [`${SwitchSelectorColor.PRIMARY}`]: "border-primary text-primary",
44329
- [`${SwitchSelectorColor.SECONDARY}`]: "border-secondary text-secondary",
44330
- [`${SwitchSelectorColor.DESTRUCTIVE}`]: "border-destructive bg-destructive text-destructive",
44331
- [`${SwitchSelectorColor.NEUTRAL}`]: "border-neutral text-neutral",
44332
- [`${SwitchSelectorColor.LIGHT}`]: "border-white text-white",
44333
- [`${SwitchSelectorColor.DARK}`]: "border-neutral-800 text-neutral-800",
44334
- [`${SwitchSelectorColor.TEXT}`]: "border-text text-text"
44335
- } },
44336
- defaultVariants: { color: `${SwitchSelectorColor.PRIMARY}` }
44343
+ variants: {
44344
+ color: {
44345
+ [`${SwitchSelectorColor.PRIMARY}`]: "border-primary text-primary",
44346
+ [`${SwitchSelectorColor.SECONDARY}`]: "border-secondary text-secondary",
44347
+ [`${SwitchSelectorColor.DESTRUCTIVE}`]: "border-destructive bg-destructive text-destructive",
44348
+ [`${SwitchSelectorColor.NEUTRAL}`]: "border-neutral text-neutral",
44349
+ [`${SwitchSelectorColor.LIGHT}`]: "border-white text-white",
44350
+ [`${SwitchSelectorColor.DARK}`]: "border-neutral-800 text-neutral-800",
44351
+ [`${SwitchSelectorColor.TEXT}`]: "border-text text-text"
44352
+ },
44353
+ disabled: {
44354
+ true: "cursor-not-allowed opacity-50",
44355
+ false: ""
44356
+ }
44357
+ },
44358
+ defaultVariants: {
44359
+ color: `${SwitchSelectorColor.PRIMARY}`,
44360
+ disabled: false
44361
+ }
44337
44362
  });
44338
44363
  let SwitchSelectorSize = /* @__PURE__ */ (function(SwitchSelectorSize$1) {
44339
44364
  SwitchSelectorSize$1["SM"] = "sm";
@@ -44358,7 +44383,7 @@ const indicatorVariant$1 = cva("absolute top-0 z-0 h-full w-auto rounded-full tr
44358
44383
  [`${SwitchSelectorColor.DARK}`]: "bg-neutral-800 data-[indicator=true]:text-white",
44359
44384
  [`${SwitchSelectorColor.TEXT}`]: "bg-text data-[indicator=true]:text-text-opposite"
44360
44385
  } } });
44361
- const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className, hoverable = true }) => {
44386
+ const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className, hoverable = true, disabled = false }) => {
44362
44387
  const [valueState, setValue] = reactExports.useState(value ?? defaultValue ?? choices[0].value);
44363
44388
  const [hoveredIndex, setHoveredIndex] = reactExports.useState(null);
44364
44389
  const optionsRefs = reactExports.useRef([]);
@@ -44377,9 +44402,11 @@ const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChang
44377
44402
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
44378
44403
  className: switchSelectorVariant({
44379
44404
  color: color2,
44405
+ disabled,
44380
44406
  className
44381
44407
  }),
44382
44408
  role: "tablist",
44409
+ "aria-disabled": disabled ? "true" : void 0,
44383
44410
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
44384
44411
  className: "relative flex size-full flex-row items-center justify-center",
44385
44412
  children: [choices.map((choice, index2) => {
@@ -44389,19 +44416,19 @@ const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChang
44389
44416
  const isIndicatorOwner = index2 === indicatorIndex;
44390
44417
  return /* @__PURE__ */ reactExports.createElement("button", {
44391
44418
  ...buttonProps,
44392
- className: cn$2(choiceVariant({ size: size2 })),
44419
+ className: cn$2(choiceVariant({ size: size2 }), disabled && "cursor-not-allowed"),
44393
44420
  key: isKeyOfKey ? value$1 : index2,
44394
44421
  role: "tab",
44395
44422
  onClick: () => handleChange(value$1),
44396
44423
  "aria-selected": isSelected ? "true" : void 0,
44397
44424
  "data-indicator": isIndicatorOwner ? "true" : void 0,
44398
- disabled: isSelected,
44425
+ disabled: disabled || isSelected,
44399
44426
  tabIndex: isSelected ? 0 : -1,
44400
44427
  ref: (el) => {
44401
44428
  optionsRefs.current[index2] = el;
44402
44429
  },
44403
- onMouseEnter: () => setHoveredIndex(index2),
44404
- onMouseLeave: () => setHoveredIndex(null)
44430
+ onMouseEnter: () => !disabled && setHoveredIndex(index2),
44431
+ onMouseLeave: () => !disabled && setHoveredIndex(null)
44405
44432
  }, content2);
44406
44433
  }), choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
44407
44434
  className: cn$2(indicatorVariant$1({ color: color2 })),
@@ -47428,7 +47455,7 @@ const Form$1 = ({ schema, onSubmit: onSubmitProp, onSubmitSuccess: onSubmitSucce
47428
47455
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, {
47429
47456
  ...props,
47430
47457
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("form", {
47431
- className: cn$2("flex size-full flex-col gap-y-6", className),
47458
+ className: cn$2("flex flex-col gap-y-6", className),
47432
47459
  onSubmit: props.handleSubmit(onSubmit),
47433
47460
  autoComplete: autoComplete ? "on" : "off",
47434
47461
  noValidate: true,
@@ -49074,7 +49101,7 @@ const usePersistedStore = (key2, initialState) => {
49074
49101
  });
49075
49102
  reactExports.useEffect(() => {
49076
49103
  const persistedState = localStorage?.getItem(key2);
49077
- if (persistedState && state === void 0) try {
49104
+ if (persistedState && persistedState !== "undefined" && state === void 0) try {
49078
49105
  setState2(JSON.parse(persistedState));
49079
49106
  } catch (e) {
49080
49107
  console.error(e);
@@ -49084,22 +49111,31 @@ const usePersistedStore = (key2, initialState) => {
49084
49111
  const setStateWrapper = reactExports.useCallback((valueOrUpdater) => {
49085
49112
  setState2((prev) => {
49086
49113
  const newValue = typeof valueOrUpdater === "function" ? valueOrUpdater(prev) : valueOrUpdater;
49087
- localStorage?.setItem(key2, JSON.stringify(newValue));
49088
- return newValue;
49114
+ if (newValue && newValue !== "undefined") {
49115
+ localStorage?.setItem(key2, JSON.stringify(newValue));
49116
+ return newValue;
49117
+ }
49118
+ return prev;
49089
49119
  });
49090
49120
  }, [key2, setState2]);
49091
49121
  const loadState = reactExports.useCallback(() => {
49092
49122
  const savedState = localStorage?.getItem(key2);
49093
49123
  if (savedState) setState2(JSON.parse(savedState));
49094
49124
  }, [key2, setState2]);
49125
+ const clearState = reactExports.useCallback(() => {
49126
+ localStorage?.removeItem(key2);
49127
+ setState2(void 0);
49128
+ }, [key2]);
49095
49129
  return reactExports.useMemo(() => [
49096
49130
  state,
49097
49131
  setStateWrapper,
49098
- loadState
49132
+ loadState,
49133
+ clearState
49099
49134
  ], [
49100
49135
  state,
49101
49136
  setStateWrapper,
49102
- loadState
49137
+ loadState,
49138
+ clearState
49103
49139
  ]);
49104
49140
  };
49105
49141
  const LocaleSwitcherContentContext = reactExports.createContext({
@@ -50677,7 +50713,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
50677
50713
  }, `line-${index2}-${line.slice(0, 10)}`)) })
50678
50714
  })
50679
50715
  });
50680
- const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-Cf2gZa5F.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
50716
+ const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-BIc1keW9.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
50681
50717
  const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
50682
50718
  className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
50683
50719
  ...props,
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Intlayer Editor</title>
8
- <script type="module" crossorigin src="/assets/index-0ibbfhRF.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CVWuS5bN.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-xMTI_9fM.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "7.5.0",
3
+ "version": "7.5.2-canary.0",
4
4
  "private": false,
5
5
  "description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
6
6
  "keywords": [
@@ -85,21 +85,21 @@
85
85
  "typecheck": "tsc --project ./server/tsconfig.types.json --noEmit"
86
86
  },
87
87
  "dependencies": {
88
- "@intlayer/chokidar": "7.5.0",
89
- "@intlayer/config": "7.5.0",
90
- "@intlayer/unmerged-dictionaries-entry": "7.5.0",
88
+ "@intlayer/chokidar": "7.5.2-canary.0",
89
+ "@intlayer/config": "7.5.2-canary.0",
90
+ "@intlayer/unmerged-dictionaries-entry": "7.5.2-canary.0",
91
91
  "compression": "1.8.1",
92
92
  "cookie-parser": "1.4.7",
93
93
  "cors": "2.8.5",
94
94
  "express": "5.2.1",
95
- "express-intlayer": "7.5.0",
95
+ "express-intlayer": "7.5.2-canary.0",
96
96
  "helmet": "8.1.0",
97
97
  "mime": "4.1.0"
98
98
  },
99
99
  "devDependencies": {
100
- "@intlayer/design-system": "7.5.0",
101
- "@intlayer/editor-react": "7.5.0",
102
- "@intlayer/types": "7.5.0",
100
+ "@intlayer/design-system": "7.5.2-canary.0",
101
+ "@intlayer/editor-react": "7.5.2-canary.0",
102
+ "@intlayer/types": "7.5.2-canary.0",
103
103
  "@tailwindcss/vite": "4.1.16",
104
104
  "@tanstack/react-query": "5.90.12",
105
105
  "@types/compression": "1.8.1",
@@ -117,18 +117,18 @@
117
117
  "framer-motion": "12.23.26",
118
118
  "fuse.js": "7.1.0",
119
119
  "globals": "16.5.0",
120
- "intlayer": "7.5.0",
120
+ "intlayer": "7.5.2-canary.0",
121
121
  "lucide-react": "0.561.0",
122
122
  "react": "19.2.3",
123
123
  "react-dom": "19.2.3",
124
- "react-intlayer": "7.5.0",
124
+ "react-intlayer": "7.5.2-canary.0",
125
125
  "react-router-dom": "7.9.5",
126
126
  "tailwind-merge": "3.4.0",
127
127
  "tailwindcss": "4.1.18",
128
128
  "tsdown": "0.18.1",
129
129
  "typescript": "5.9.3",
130
130
  "vite": "7.3.0",
131
- "vite-intlayer": "7.5.0",
131
+ "vite-intlayer": "7.5.2-canary.0",
132
132
  "vitest": "4.0.16"
133
133
  },
134
134
  "engines": {