intlayer-editor 8.0.1-canary.0 → 8.0.1

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-CWEOkb3q.js","assets/css-BtVcDqlU.js","assets/javascript-DLs729Nk.js","assets/typescript-Cju7JbYj.js","assets/json-D07AUpjp.js","assets/html-BOjX3v2Q.js","assets/html-derivative-Cswrtqyq.js","assets/bundle-web-qxQeRCYN.js","assets/index-DcVTxIaJ.js","assets/index-_x1aw6QY.css"])))=>i.map(i=>d[i]);
2
- import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-DcVTxIaJ.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue-CWEOkb3q.js","assets/css-BtVcDqlU.js","assets/javascript-DLs729Nk.js","assets/typescript-Cju7JbYj.js","assets/json-D07AUpjp.js","assets/html-BOjX3v2Q.js","assets/html-derivative-Cswrtqyq.js","assets/bundle-web-BDVF7A6G.js","assets/index-BU3FPqJD.js","assets/index-_x1aw6QY.css"])))=>i.map(i=>d[i]);
2
+ import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-BU3FPqJD.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-qxQeRCYN.js"), true ? __vite__mapDeps([7,8,9]) : void 0),
63
+ __vitePreload(() => import("./bundle-web-BDVF7A6G.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-DyeoExSN.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-DijK_igD.js","assets/python-CrdIx4PZ.js","assets/r-Dpdc-Kyk.js","assets/marko-DdYN1N-r.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-CaHM8dOn.js","assets/ts-tags-DCkNjov3.js","assets/vue-CWEOkb3q.js","assets/vue-html-Df7OYD9X.js","assets/vue-vine-Bx34p5qN.js","assets/stylus-DXFa_2Jl.js"])))=>i.map(i=>d[i]);
2
- import { _ as __vitePreload } from "./index-DcVTxIaJ.js";
2
+ import { _ as __vitePreload } from "./index-BU3FPqJD.js";
3
3
  let ShikiError$2 = class ShikiError extends Error {
4
4
  constructor(message) {
5
5
  super(message);
@@ -13826,6 +13826,19 @@ const findMatchingCondition = (enumerationContent, quantity) => {
13826
13826
  const getEnumeration = (enumerationContent, quantity) => {
13827
13827
  return enumerationContent[findMatchingCondition(enumerationContent, quantity) ?? "fallback"];
13828
13828
  };
13829
+ const getGenderEntry = (gender) => {
13830
+ if (gender === "m" || gender === "male") return "male";
13831
+ if (gender === "f" || gender === "female") return "female";
13832
+ return "fallback";
13833
+ };
13834
+ const getGender = (genderContent, gender) => {
13835
+ const stateList = Object.keys(genderContent);
13836
+ const fallbackState = stateList[stateList.length - 1];
13837
+ return genderContent[getGenderEntry(gender)] ?? genderContent.fallback ?? genderContent[fallbackState];
13838
+ };
13839
+ const getInsertion = (content2, values) => content2.replace(/\{\{\s*(.*?)\s*\}\}/g, (_2, key2) => {
13840
+ return (values[key2.trim()] ?? "").toString();
13841
+ });
13829
13842
  const internationalization = { "locales": ["en", "en-GB", "fr", "es", "de", "ja", "ko", "zh", "it", "pt", "hi", "ar", "ru"], "defaultLocale": "en" };
13830
13843
  const routing = { "mode": "prefix-no-default", "storage": ["cookie", "header"] };
13831
13844
  const editor$1 = { "applicationURL": "", "editorURL": "http://localhost:8000", "cmsURL": "https://app.intlayer.org", "backendURL": "https://back.intlayer.org", "port": 8e3, "enabled": true, "dictionaryPriorityStrategy": "local_first", "liveSync": true, "liveSyncPort": 4e3, "liveSyncURL": "http://localhost:4000" };
@@ -13992,6 +14005,58 @@ const conditionPlugin = {
13992
14005
  };
13993
14006
  }
13994
14007
  };
14008
+ const insertionPlugin$1 = {
14009
+ id: "insertion-plugin",
14010
+ canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Insertion,
14011
+ transform: (node, props, deepTransformNode2) => {
14012
+ const newKeyPath = [...props.keyPath, { type: NodeType.Insertion }];
14013
+ const children = node[NodeType.Insertion];
14014
+ const insertionStringPlugin = {
14015
+ id: "insertion-string-plugin",
14016
+ canHandle: (node2) => typeof node2 === "string",
14017
+ transform: (node2, subProps, deepTransformNode3) => {
14018
+ const transformedResult = deepTransformNode3(node2, {
14019
+ ...subProps,
14020
+ children: node2,
14021
+ plugins: [...(props.plugins ?? []).filter((plugin) => plugin.id !== "intlayer-node-plugin")]
14022
+ });
14023
+ return (values) => {
14024
+ const children2 = getInsertion(transformedResult, values);
14025
+ return deepTransformNode3(children2, {
14026
+ ...subProps,
14027
+ plugins: props.plugins,
14028
+ children: children2
14029
+ });
14030
+ };
14031
+ }
14032
+ };
14033
+ return deepTransformNode2(children, {
14034
+ ...props,
14035
+ children,
14036
+ keyPath: newKeyPath,
14037
+ plugins: [insertionStringPlugin, ...props.plugins ?? []]
14038
+ });
14039
+ }
14040
+ };
14041
+ const genderPlugin = {
14042
+ id: "gender-plugin",
14043
+ canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Gender,
14044
+ transform: (node, props, deepTransformNode2) => {
14045
+ const result = structuredClone(node[NodeType.Gender]);
14046
+ for (const key2 in result) {
14047
+ const child = result[key2];
14048
+ result[key2] = deepTransformNode2(child, {
14049
+ ...props,
14050
+ children: child,
14051
+ keyPath: [...props.keyPath, {
14052
+ type: NodeType.Gender,
14053
+ key: key2
14054
+ }]
14055
+ });
14056
+ }
14057
+ return (value) => getGender(result, value);
14058
+ }
14059
+ };
13995
14060
  const nestedPlugin = (locale) => ({
13996
14061
  id: "nested-plugin",
13997
14062
  canHandle: (node) => typeof node === "object" && (node?.nodeType === NodeType.Nested || node?.nodeType === "nested"),
@@ -14016,6 +14081,8 @@ const getContent = (node, nodeProps, locale, fallback) => {
14016
14081
  conditionPlugin,
14017
14082
  nestedPlugin(locale ?? defaultLocale),
14018
14083
  filePlugin,
14084
+ insertionPlugin$1,
14085
+ genderPlugin,
14019
14086
  ...nodeProps.plugins ?? []
14020
14087
  ];
14021
14088
  return deepTransformNode(node, {
@@ -17434,7 +17501,7 @@ const insertionPlugin = {
17434
17501
  keyPath: newKeyPath,
17435
17502
  plugins: [insertionStringPlugin, ...props.plugins ?? []]
17436
17503
  });
17437
- if (typeof children === "object" && children !== null && "nodeType" in children && (children.nodeType === NodeType.Enumeration || children.nodeType === NodeType.Condition)) return (values) => (arg) => {
17504
+ if (typeof children === "object" && children !== null && "nodeType" in children && [NodeType.Enumeration, NodeType.Condition].includes(children.nodeType)) return (values) => (arg) => {
17438
17505
  const inner = result(arg);
17439
17506
  if (typeof inner === "function") return inner(values);
17440
17507
  return inner;
@@ -35803,7 +35870,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
35803
35870
  }, `line-${index2}-${line.slice(0, 10)}`)) : children })
35804
35871
  })
35805
35872
  });
35806
- const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-49CDTk3P.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
35873
+ const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-BjiX57mw.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
35807
35874
  const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
35808
35875
  className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
35809
35876
  ...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-DcVTxIaJ.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BU3FPqJD.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-_x1aw6QY.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "8.0.1-canary.0",
3
+ "version": "8.0.1",
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": [
@@ -91,17 +91,17 @@
91
91
  "@fastify/formbody": "^8.0.0",
92
92
  "@fastify/helmet": "^13.0.2",
93
93
  "@fastify/static": "^9.0.0",
94
- "@intlayer/chokidar": "8.0.1-canary.0",
95
- "@intlayer/config": "8.0.1-canary.0",
96
- "@intlayer/unmerged-dictionaries-entry": "8.0.1-canary.0",
94
+ "@intlayer/chokidar": "8.0.1",
95
+ "@intlayer/config": "8.0.1",
96
+ "@intlayer/unmerged-dictionaries-entry": "8.0.1",
97
97
  "fastify": "5.7.2",
98
- "fastify-intlayer": "8.0.1-canary.0",
98
+ "fastify-intlayer": "8.0.1",
99
99
  "mime": "4.1.0"
100
100
  },
101
101
  "devDependencies": {
102
- "@intlayer/design-system": "8.0.1-canary.0",
103
- "@intlayer/editor-react": "8.0.1-canary.0",
104
- "@intlayer/types": "8.0.1-canary.0",
102
+ "@intlayer/design-system": "8.0.1",
103
+ "@intlayer/editor-react": "8.0.1",
104
+ "@intlayer/types": "8.0.1",
105
105
  "@tailwindcss/vite": "4.1.18",
106
106
  "@tanstack/react-query": "5.90.20",
107
107
  "@types/node": "25.0.10",
@@ -115,18 +115,18 @@
115
115
  "framer-motion": "12.29.2",
116
116
  "fuse.js": "7.1.0",
117
117
  "globals": "16.5.0",
118
- "intlayer": "8.0.1-canary.0",
118
+ "intlayer": "8.0.1",
119
119
  "lucide-react": "0.563.0",
120
120
  "react": "19.2.4",
121
121
  "react-dom": "19.2.4",
122
- "react-intlayer": "8.0.1-canary.0",
122
+ "react-intlayer": "8.0.1",
123
123
  "react-router-dom": "7.12.0",
124
124
  "tailwind-merge": "3.4.0",
125
125
  "tailwindcss": "4.1.18",
126
126
  "tsdown": "0.20.1",
127
127
  "typescript": "5.9.3",
128
128
  "vite": "7.3.1",
129
- "vite-intlayer": "8.0.1-canary.0",
129
+ "vite-intlayer": "8.0.1",
130
130
  "vitest": "4.0.18"
131
131
  },
132
132
  "engines": {