vue-intlayer 8.4.3 → 8.4.5

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 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../ContentSelector-CAg85Zo3.js`),n=require(`./markdown/installIntlayerMarkdown.cjs`),r=require(`./renderIntlayerNode.cjs`);let i=require(`@intlayer/core/interpreter`),a=require(`@intlayer/config/built`);a=e.t(a);let o=require(`@intlayer/core/markdown`),s=require(`@intlayer/core/transpiler`),c=require(`@intlayer/types/nodeType`),l=require(`vue`);var u={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:n,...i})=>{let o=e=>r.renderIntlayerNode({...i,value:e,children:a.default?.editor.enabled?()=>(0,l.h)(t.t,{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},{default:()=>typeof e==`function`?e():e}):e}),s=o(n);if(typeof n!=`function`)return s;let c=(...e)=>o(n(...e));Object.setPrototypeOf(c,Object.getPrototypeOf(s));for(let e of Object.getOwnPropertyNames(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}for(let e of Object.getOwnPropertySymbols(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}return(0,l.markRaw)(c)}},d=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let a=(0,i.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(a.isSimple){let t=a.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,l.h)(l.Fragment,null,...e)}else return a.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,l.h)(l.Fragment,null,...e)}return a.isSimple?a.parts:(0,l.h)(l.Fragment,null,a.parts)},f={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.NodeType.Insertion,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.NodeType.Insertion}],i=e[c.NodeType.Insertion],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=d(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},p={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,i,a)=>{let{plugins:s,...c}=i,u=a((0,o.getMarkdownMetadata)(e),{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>r.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:c.dictionaryKey,keyPath:[]}),d=a=>r.renderIntlayerNode({...i,value:e,children:()=>(0,l.h)(t.t,{dictionaryKey:c.dictionaryKey,keyPath:c.keyPath},{default:()=>{let{renderMarkdown:t,components:r}=n.useMarkdown();return t(e,void 0,{...r??{},...a??{}})}}),additionalProps:{metadata:u}}),f=d();return new Proxy(f,{get(t,n,r){return n===`value`?e:n===`metadata`?u:n===`use`?e=>d(e):Reflect.get(t,n,r)}})}},m={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.NodeType.Markdown,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.NodeType.Markdown}],i=e[c.NodeType.Markdown];return n(i,{...t,children:i,keyPath:r,plugins:[p,...t.plugins??[]]})}},h=(()=>{let e={};for(let t of s.HTML_TAGS)e[t]=({children:e,...n})=>(0,l.h)(t,n,e);return e})(),g={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.NodeType.HTML,transform:(e,t)=>{let n=e[c.NodeType.HTML];e.tags;let a=e=>(0,i.getHTML)(n,{...h,...e});return r.renderIntlayerNode({...t,value:n,children:e=>a(e)})}},_=(e,t=!0)=>[(0,i.translationPlugin)(e??a.default.internationalization.defaultLocale,t?a.default.internationalization.defaultLocale:void 0),i.enumerationPlugin,i.conditionPlugin,(0,i.nestedPlugin)(e??a.default.internationalization.defaultLocale),i.filePlugin,i.genderPlugin,u,f,m,g];exports.getPlugins=_,exports.htmlPlugin=g,exports.insertionPlugin=f,exports.intlayerNodePlugins=u,exports.markdownPlugin=m,exports.markdownStringPlugin=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../ContentSelector-CAg85Zo3.js`),n=require(`./markdown/installIntlayerMarkdown.cjs`),r=require(`./renderIntlayerNode.cjs`);let i=require(`@intlayer/core/interpreter`),a=require(`@intlayer/config/built`);a=e.t(a);let o=require(`@intlayer/core/markdown`),s=require(`@intlayer/core/transpiler`),c=require(`@intlayer/types/nodeType`);c=e.t(c);let l=require(`vue`);var u={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:n,...i})=>{let o=e=>r.renderIntlayerNode({...i,value:e,children:a.default?.editor.enabled?()=>(0,l.h)(t.t,{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},{default:()=>typeof e==`function`?e():e}):e}),s=o(n);if(typeof n!=`function`)return s;let c=(...e)=>o(n(...e));Object.setPrototypeOf(c,Object.getPrototypeOf(s));for(let e of Object.getOwnPropertyNames(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}for(let e of Object.getOwnPropertySymbols(s)){let t=Object.getOwnPropertyDescriptor(s,e);t&&Object.defineProperty(c,e,t)}return(0,l.markRaw)(c)}},d=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let a=(0,i.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(a.isSimple){let t=a.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,l.h)(l.Fragment,null,...e)}else return a.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,l.h)(l.Fragment,null,...e)}return a.isSimple?a.parts:(0,l.h)(l.Fragment,null,a.parts)},f={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.INSERTION}],i=e[c.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=d(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},p={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,i,a)=>{let{plugins:s,...c}=i,u=a((0,o.getMarkdownMetadata)(e),{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>r.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:c.dictionaryKey,keyPath:[]}),d=a=>r.renderIntlayerNode({...i,value:e,children:()=>(0,l.h)(t.t,{dictionaryKey:c.dictionaryKey,keyPath:c.keyPath},{default:()=>{let{renderMarkdown:t,components:r}=n.useMarkdown();return t(e,void 0,{...r??{},...a??{}})}}),additionalProps:{metadata:u}}),f=d();return new Proxy(f,{get(t,n,r){return n===`value`?e:n===`metadata`?u:n===`use`?e=>d(e):Reflect.get(t,n,r)}})}},m={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:c.MARKDOWN}],i=e[c.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[p,...t.plugins??[]]})}},h=(()=>{let e={};for(let t of s.HTML_TAGS)e[t]=({children:e,...n})=>(0,l.h)(t,n,e);return e})(),g={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===c.HTML,transform:(e,t)=>{let n=e[c.HTML];e.tags;let a=e=>(0,i.getHTML)(n,{...h,...e});return r.renderIntlayerNode({...t,value:n,children:e=>a(e)})}},_=(e,t=!0)=>[(0,i.translationPlugin)(e??a.default.internationalization.defaultLocale,t?a.default.internationalization.defaultLocale:void 0),i.enumerationPlugin,i.conditionPlugin,(0,i.nestedPlugin)(e??a.default.internationalization.defaultLocale),i.filePlugin,i.genderPlugin,u,f,m,g];exports.getPlugins=_,exports.htmlPlugin=g,exports.insertionPlugin=f,exports.intlayerNodePlugins=u,exports.markdownPlugin=m,exports.markdownStringPlugin=p;
@@ -5,7 +5,7 @@ import { conditionPlugin as r, enumerationPlugin as i, filePlugin as a, genderPl
5
5
  import d from "@intlayer/config/built";
6
6
  import { getMarkdownMetadata as f } from "@intlayer/core/markdown";
7
7
  import { HTML_TAGS as p } from "@intlayer/core/transpiler";
8
- import { NodeType as m } from "@intlayer/types/nodeType";
8
+ import * as m from "@intlayer/types/nodeType";
9
9
  import { Fragment as h, h as g, markRaw as _ } from "vue";
10
10
  //#region src/plugins.ts
11
11
  var v = {
@@ -60,9 +60,9 @@ var v = {
60
60
  return i.isSimple ? i.parts : g(h, null, i.parts);
61
61
  }, b = {
62
62
  id: "insertion-plugin",
63
- canHandle: (e) => typeof e == "object" && e?.nodeType === m.Insertion,
63
+ canHandle: (e) => typeof e == "object" && e?.nodeType === m.INSERTION,
64
64
  transform: (e, t, n) => {
65
- let r = [...t.keyPath, { type: m.Insertion }], i = e[m.Insertion], a = {
65
+ let r = [...t.keyPath, { type: m.INSERTION }], i = e[m.INSERTION], a = {
66
66
  id: "insertion-string-plugin",
67
67
  canHandle: (e) => typeof e == "string",
68
68
  transform: (e, n, r) => {
@@ -125,9 +125,9 @@ var v = {
125
125
  }
126
126
  }, S = {
127
127
  id: "markdown-plugin",
128
- canHandle: (e) => typeof e == "object" && e?.nodeType === m.Markdown,
128
+ canHandle: (e) => typeof e == "object" && e?.nodeType === m.MARKDOWN,
129
129
  transform: (e, t, n) => {
130
- let r = [...t.keyPath, { type: m.Markdown }], i = e[m.Markdown];
130
+ let r = [...t.keyPath, { type: m.MARKDOWN }], i = e[m.MARKDOWN];
131
131
  return n(i, {
132
132
  ...t,
133
133
  children: i,
@@ -4,6 +4,7 @@ import { NodeType } from '@intlayer/types/nodeType';
4
4
  import { VNode } from 'vue';
5
5
  import { HTMLComponents } from './html/types';
6
6
  import { IntlayerNode as IntlayerNodeCore } from './renderIntlayerNode';
7
+ import * as NodeTypes from '@intlayer/types/nodeType';
7
8
  /** ---------------------------------------------
8
9
  * INTLAYER NODE PLUGIN
9
10
  * --------------------------------------------- */
@@ -16,7 +17,7 @@ export declare const intlayerNodePlugins: Plugins;
16
17
  * --------------------------------------------- */
17
18
  export type InsertionCond<T, _S, _L> = T extends {
18
19
  nodeType: NodeType | string;
19
- [NodeType.Insertion]: string;
20
+ [NodeTypes.INSERTION]: string;
20
21
  fields: readonly string[];
21
22
  } ? <V extends {
22
23
  [K in T['fields'][number]]: VNode;
@@ -34,7 +35,7 @@ export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
34
35
  export declare const markdownStringPlugin: Plugins;
35
36
  export type MarkdownCond<T> = T extends {
36
37
  nodeType: NodeType | string;
37
- [NodeType.Markdown]: infer M;
38
+ [NodeTypes.MARKDOWN]: infer M;
38
39
  metadata?: infer U;
39
40
  tags?: infer U;
40
41
  } ? {
@@ -44,7 +45,7 @@ export type MarkdownCond<T> = T extends {
44
45
  export declare const markdownPlugin: Plugins;
45
46
  export type HTMLPluginCond<T> = T extends {
46
47
  nodeType: NodeType | string;
47
- [NodeType.HTML]: infer I;
48
+ [NodeTypes.HTML]: infer I;
48
49
  tags?: infer U;
49
50
  } ? {
50
51
  use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intlayer",
3
- "version": "8.4.3",
3
+ "version": "8.4.5",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -94,11 +94,11 @@
94
94
  "typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
95
95
  },
96
96
  "dependencies": {
97
- "@intlayer/api": "8.4.3",
98
- "@intlayer/config": "8.4.3",
99
- "@intlayer/core": "8.4.3",
100
- "@intlayer/editor": "8.4.3",
101
- "@intlayer/types": "8.4.3"
97
+ "@intlayer/api": "8.4.5",
98
+ "@intlayer/config": "8.4.5",
99
+ "@intlayer/core": "8.4.5",
100
+ "@intlayer/editor": "8.4.5",
101
+ "@intlayer/types": "8.4.5"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@types/node": "25.5.0",
@@ -117,7 +117,7 @@
117
117
  "vue-tsc": "3.1.5"
118
118
  },
119
119
  "peerDependencies": {
120
- "intlayer": "8.4.3",
120
+ "intlayer": "8.4.5",
121
121
  "vue": ">=3.0.0"
122
122
  },
123
123
  "peerDependenciesMeta": {