intlayer-editor 7.5.1 → 7.5.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.
@@ -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-CNJDzNQN.js","assets/index-DqbmCrrm.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-DqbmCrrm.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-Cv3RtaG8.js","assets/index-DgmacfvJ.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-DgmacfvJ.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-CNJDzNQN.js"), true ? __vite__mapDeps([7,8,9]) : void 0),
63
+ __vitePreload(() => import("./bundle-web-Cv3RtaG8.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-DqbmCrrm.js";
2
+ import { _ as __vitePreload } from "./index-DgmacfvJ.js";
3
3
  let ShikiError$2 = class ShikiError extends Error {
4
4
  constructor(message) {
5
5
  super(message);
@@ -32924,25 +32924,23 @@ var isPlainObject$2 = (tempObject) => {
32924
32924
  };
32925
32925
  var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
32926
32926
  function cloneObject(data) {
32927
- let copy;
32928
- const isArray2 = Array.isArray(data);
32929
- const isFileListInstance = typeof FileList !== "undefined" ? data instanceof FileList : false;
32930
32927
  if (data instanceof Date) {
32931
- copy = new Date(data);
32932
- } else if (!(isWeb && (data instanceof Blob || isFileListInstance)) && (isArray2 || isObject$4(data))) {
32933
- copy = isArray2 ? [] : Object.create(Object.getPrototypeOf(data));
32934
- if (!isArray2 && !isPlainObject$2(data)) {
32935
- copy = data;
32936
- } else {
32937
- for (const key2 in data) {
32938
- if (data.hasOwnProperty(key2)) {
32939
- copy[key2] = cloneObject(data[key2]);
32940
- }
32941
- }
32942
- }
32943
- } else {
32928
+ return new Date(data);
32929
+ }
32930
+ const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
32931
+ if (isWeb && (data instanceof Blob || isFileListInstance)) {
32932
+ return data;
32933
+ }
32934
+ const isArray2 = Array.isArray(data);
32935
+ if (!isArray2 && !(isObject$4(data) && isPlainObject$2(data))) {
32944
32936
  return data;
32945
32937
  }
32938
+ const copy = isArray2 ? [] : Object.create(Object.getPrototypeOf(data));
32939
+ for (const key2 in data) {
32940
+ if (Object.prototype.hasOwnProperty.call(data, key2)) {
32941
+ copy[key2] = cloneObject(data[key2]);
32942
+ }
32943
+ }
32946
32944
  return copy;
32947
32945
  }
32948
32946
  var isKey = (value) => /^\w*$/.test(value);
@@ -32957,6 +32955,7 @@ var get$2 = (object2, path, defaultValue) => {
32957
32955
  return isUndefined(result) || result === object2 ? isUndefined(object2[path]) ? defaultValue : object2[path] : result;
32958
32956
  };
32959
32957
  var isBoolean$1 = (value) => typeof value === "boolean";
32958
+ var isFunction$2 = (value) => typeof value === "function";
32960
32959
  var set = (object2, path, value) => {
32961
32960
  let index2 = -1;
32962
32961
  const tempPath = isKey(path) ? [path] : stringToPath(path);
@@ -33220,12 +33219,12 @@ function useController(props) {
33220
33219
  }), [name, control._formValues]);
33221
33220
  const ref = We.useCallback((elm) => {
33222
33221
  const field2 = get$2(control._fields, name);
33223
- if (field2 && elm) {
33222
+ if (field2 && field2._f && elm) {
33224
33223
  field2._f.ref = {
33225
- focus: () => elm.focus && elm.focus(),
33226
- select: () => elm.select && elm.select(),
33227
- setCustomValidity: (message) => elm.setCustomValidity(message),
33228
- reportValidity: () => elm.reportValidity()
33224
+ focus: () => isFunction$2(elm.focus) && elm.focus(),
33225
+ select: () => isFunction$2(elm.select) && elm.select(),
33226
+ setCustomValidity: (message) => isFunction$2(elm.setCustomValidity) && elm.setCustomValidity(message),
33227
+ reportValidity: () => isFunction$2(elm.reportValidity) && elm.reportValidity()
33229
33228
  };
33230
33229
  }
33231
33230
  }, [control._fields, name]);
@@ -33335,7 +33334,6 @@ function extractFormValues(fieldsState, formValues) {
33335
33334
  }
33336
33335
  var isEmptyObject = (value) => isObject$4(value) && !Object.keys(value).length;
33337
33336
  var isFileInput = (element) => element.type === "file";
33338
- var isFunction$2 = (value) => typeof value === "function";
33339
33337
  var isHTMLElement$2 = (value) => {
33340
33338
  if (!isWeb) {
33341
33339
  return false;
@@ -33765,7 +33763,8 @@ function createFormControl(props = {}) {
33765
33763
  let _state = {
33766
33764
  action: false,
33767
33765
  mount: false,
33768
- watch: false
33766
+ watch: false,
33767
+ keepIsValid: false
33769
33768
  };
33770
33769
  let _names = {
33771
33770
  mount: /* @__PURE__ */ new Set(),
@@ -33776,7 +33775,7 @@ function createFormControl(props = {}) {
33776
33775
  };
33777
33776
  let delayErrorCallback;
33778
33777
  let timer = 0;
33779
- const _proxyFormState = {
33778
+ const defaultProxyFormState = {
33780
33779
  isDirty: false,
33781
33780
  dirtyFields: false,
33782
33781
  validatingFields: false,
@@ -33785,6 +33784,9 @@ function createFormControl(props = {}) {
33785
33784
  isValid: false,
33786
33785
  errors: false
33787
33786
  };
33787
+ const _proxyFormState = {
33788
+ ...defaultProxyFormState
33789
+ };
33788
33790
  let _proxySubscribeFormState = {
33789
33791
  ..._proxyFormState
33790
33792
  };
@@ -33798,8 +33800,17 @@ function createFormControl(props = {}) {
33798
33800
  timer = setTimeout(callback, wait);
33799
33801
  };
33800
33802
  const _setValid = async (shouldUpdateValid) => {
33803
+ if (_state.keepIsValid) {
33804
+ return;
33805
+ }
33801
33806
  if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
33802
- const isValid = _options.resolver ? isEmptyObject((await _runSchema()).errors) : await executeBuiltInValidation(_fields, true);
33807
+ let isValid;
33808
+ if (_options.resolver) {
33809
+ isValid = isEmptyObject((await _runSchema()).errors);
33810
+ _updateIsValidating();
33811
+ } else {
33812
+ isValid = await executeBuiltInValidation(_fields, true);
33813
+ }
33803
33814
  if (isValid !== _formState.isValid) {
33804
33815
  _subjects.state.next({
33805
33816
  isValid
@@ -33930,11 +33941,11 @@ function createFormControl(props = {}) {
33930
33941
  const _runSchema = async (name) => {
33931
33942
  _updateIsValidating(name, true);
33932
33943
  const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
33933
- _updateIsValidating(name);
33934
33944
  return result;
33935
33945
  };
33936
33946
  const executeSchemaAndUpdateState = async (names) => {
33937
33947
  const { errors } = await _runSchema(names);
33948
+ _updateIsValidating(names);
33938
33949
  if (names) {
33939
33950
  for (const name of names) {
33940
33951
  const error = get$2(errors, name);
@@ -34113,6 +34124,7 @@ function createFormControl(props = {}) {
34113
34124
  !isBlurEvent && watched && _subjects.state.next({ ..._formState });
34114
34125
  if (_options.resolver) {
34115
34126
  const { errors } = await _runSchema([name]);
34127
+ _updateIsValidating([name]);
34116
34128
  _updateIsFieldValueUpdated(fieldValue);
34117
34129
  if (isFieldValueUpdated) {
34118
34130
  const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
@@ -34233,7 +34245,10 @@ function createFormControl(props = {}) {
34233
34245
  };
34234
34246
  return _subscribe({
34235
34247
  ...props2,
34236
- formState: _proxySubscribeFormState
34248
+ formState: {
34249
+ ...defaultProxyFormState,
34250
+ ...props2.formState
34251
+ }
34237
34252
  });
34238
34253
  };
34239
34254
  const unregister = (name, options = {}) => {
@@ -34361,6 +34376,7 @@ function createFormControl(props = {}) {
34361
34376
  });
34362
34377
  if (_options.resolver) {
34363
34378
  const { errors, values } = await _runSchema();
34379
+ _updateIsValidating();
34364
34380
  _formState.errors = errors;
34365
34381
  fieldValues = cloneObject(values);
34366
34382
  } else {
@@ -34481,6 +34497,7 @@ function createFormControl(props = {}) {
34481
34497
  };
34482
34498
  _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
34483
34499
  _state.watch = !!_options.shouldUnregister;
34500
+ _state.keepIsValid = !!keepStateOptions.keepIsValid;
34484
34501
  _state.action = false;
34485
34502
  if (!keepStateOptions.keepErrors) {
34486
34503
  _formState.errors = {};
@@ -34497,15 +34514,17 @@ function createFormControl(props = {}) {
34497
34514
  defaultValues: _defaultValues
34498
34515
  });
34499
34516
  };
34500
- const reset = (formValues, keepStateOptions) => _reset(isFunction$2(formValues) ? formValues(_formValues) : formValues, keepStateOptions);
34517
+ const reset = (formValues, keepStateOptions) => _reset(isFunction$2(formValues) ? formValues(_formValues) : formValues, { ..._options.resetOptions, ...keepStateOptions });
34501
34518
  const setFocus = (name, options = {}) => {
34502
34519
  const field = get$2(_fields, name);
34503
34520
  const fieldReference = field && field._f;
34504
34521
  if (fieldReference) {
34505
34522
  const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
34506
34523
  if (fieldRef.focus) {
34507
- fieldRef.focus();
34508
- options.shouldSelect && isFunction$2(fieldRef.select) && fieldRef.select();
34524
+ setTimeout(() => {
34525
+ fieldRef.focus();
34526
+ options.shouldSelect && isFunction$2(fieldRef.select) && fieldRef.select();
34527
+ });
34509
34528
  }
34510
34529
  }
34511
34530
  };
@@ -34530,6 +34549,7 @@ function createFormControl(props = {}) {
34530
34549
  setError,
34531
34550
  _subscribe,
34532
34551
  _runSchema,
34552
+ _updateIsValidating,
34533
34553
  _focusError,
34534
34554
  _getWatch,
34535
34555
  _getDirty,
@@ -37704,12 +37724,7 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
37704
37724
  const deleteOrganization = async (otherOptions = {}) => await fetcher(ORGANIZATION_API_ROUTE, authAPIOptions, otherOptions, { method: "DELETE" });
37705
37725
  const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`, authAPIOptions, otherOptions, { method: "PUT" });
37706
37726
  const unselectOrganization = async (otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
37707
- const getOrganizationSSOConfig = async (body, otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/sso`, authAPIOptions, otherOptions, {
37708
- method: "POST",
37709
- body
37710
- });
37711
37727
  return {
37712
- getOrganizationSSOConfig,
37713
37728
  getOrganizations,
37714
37729
  getOrganization,
37715
37730
  addOrganization,
@@ -50718,7 +50733,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
50718
50733
  }, `line-${index2}-${line.slice(0, 10)}`)) })
50719
50734
  })
50720
50735
  });
50721
- const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-BDi8XZg1.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
50736
+ const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-BYCotUx9.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
50722
50737
  const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
50723
50738
  className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
50724
50739
  ...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-DqbmCrrm.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DgmacfvJ.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.1",
3
+ "version": "7.5.2",
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.1",
89
- "@intlayer/config": "7.5.1",
90
- "@intlayer/unmerged-dictionaries-entry": "7.5.1",
88
+ "@intlayer/chokidar": "7.5.2",
89
+ "@intlayer/config": "7.5.2",
90
+ "@intlayer/unmerged-dictionaries-entry": "7.5.2",
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.1",
95
+ "express-intlayer": "7.5.2",
96
96
  "helmet": "8.1.0",
97
97
  "mime": "4.1.0"
98
98
  },
99
99
  "devDependencies": {
100
- "@intlayer/design-system": "7.5.1",
101
- "@intlayer/editor-react": "7.5.1",
102
- "@intlayer/types": "7.5.1",
100
+ "@intlayer/design-system": "7.5.2",
101
+ "@intlayer/editor-react": "7.5.2",
102
+ "@intlayer/types": "7.5.2",
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.1",
121
- "lucide-react": "0.561.0",
120
+ "intlayer": "7.5.2",
121
+ "lucide-react": "0.562.0",
122
122
  "react": "19.2.3",
123
123
  "react-dom": "19.2.3",
124
- "react-intlayer": "7.5.1",
124
+ "react-intlayer": "7.5.2",
125
125
  "react-router-dom": "7.9.5",
126
126
  "tailwind-merge": "3.4.0",
127
127
  "tailwindcss": "4.1.18",
128
- "tsdown": "0.18.1",
128
+ "tsdown": "0.18.2",
129
129
  "typescript": "5.9.3",
130
130
  "vite": "7.3.0",
131
- "vite-intlayer": "7.5.1",
131
+ "vite-intlayer": "7.5.2",
132
132
  "vitest": "4.0.16"
133
133
  },
134
134
  "engines": {