vue-intlayer 5.7.8 → 5.8.0-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.
- package/README.md +1 -1
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js +1 -0
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-pC3olEPG.mjs +73 -0
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs +62 -0
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-kiSW4cfM.js +1 -0
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-CilQuo_6.js +1 -0
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-GmacOkG4.mjs +36 -0
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditedContentRenderer.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/communicator.cjs +1 -1
- package/dist/cjs/editor/createSharedComposable.cjs +1 -1
- package/dist/cjs/editor/editedContent.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/format/index.cjs +1 -0
- package/dist/cjs/format/useCompact.cjs +1 -0
- package/dist/cjs/format/useCurrency.cjs +1 -0
- package/dist/cjs/format/useDate.cjs +1 -0
- package/dist/cjs/format/useList.cjs +1 -0
- package/dist/cjs/format/useNumber.cjs +1 -0
- package/dist/cjs/format/usePercentage.cjs +1 -0
- package/dist/cjs/format/useRelativeTime.cjs +1 -0
- package/dist/cjs/format/useUnit.cjs +1 -0
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/UI/ContentSelector.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +13 -16
- package/dist/esm/client/useDictionaryAsync.mjs +10 -13
- package/dist/esm/client/useDictionaryDynamic.mjs +13 -16
- package/dist/esm/client/useIntlayer.mjs +12 -12
- package/dist/esm/client/useLocale.mjs +12 -16
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/EditedContentRenderer.mjs +1 -1
- package/dist/esm/editor/EditorSelectorRenderer.mjs +2 -2
- package/dist/esm/editor/communicator.mjs +10 -10
- package/dist/esm/editor/createSharedComposable.mjs +1 -1
- package/dist/esm/editor/editedContent.mjs +22 -23
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +21 -22
- package/dist/esm/editor/useEditedContentRenderer.mjs +7 -7
- package/dist/esm/format/index.mjs +18 -0
- package/dist/esm/format/useCompact.mjs +16 -0
- package/dist/esm/format/useCurrency.mjs +16 -0
- package/dist/esm/format/useDate.mjs +16 -0
- package/dist/esm/format/useList.mjs +16 -0
- package/dist/esm/format/useNumber.mjs +16 -0
- package/dist/esm/format/usePercentage.mjs +16 -0
- package/dist/esm/format/useRelativeTime.mjs +16 -0
- package/dist/esm/format/useUnit.mjs +16 -0
- package/dist/esm/plugins.mjs +15 -15
- package/dist/types/format/index.d.ts +9 -0
- package/dist/types/format/index.d.ts.map +1 -0
- package/dist/types/format/useCompact.d.ts +14 -0
- package/dist/types/format/useCompact.d.ts.map +1 -0
- package/dist/types/format/useCurrency.d.ts +25 -0
- package/dist/types/format/useCurrency.d.ts.map +1 -0
- package/dist/types/format/useDate.d.ts +23 -0
- package/dist/types/format/useDate.d.ts.map +1 -0
- package/dist/types/format/useList.d.ts +22 -0
- package/dist/types/format/useList.d.ts.map +1 -0
- package/dist/types/format/useNumber.d.ts +23 -0
- package/dist/types/format/useNumber.d.ts.map +1 -0
- package/dist/types/format/usePercentage.d.ts +17 -0
- package/dist/types/format/usePercentage.d.ts.map +1 -0
- package/dist/types/format/useRelativeTime.d.ts +21 -0
- package/dist/types/format/useRelativeTime.d.ts.map +1 -0
- package/dist/types/format/useUnit.d.ts +19 -0
- package/dist/types/format/useUnit.d.ts.map +1 -0
- package/package.json +24 -29
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-Df1Nt4x_.mjs +0 -75
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-RwUsyBxL.js +0 -1
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CcDEyAOE.mjs +0 -68
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DJRF1I6m.js +0 -1
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-CvPgk7Z3.mjs +0 -39
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-Yqrgst_y.js +0 -1
- package/dist/cjs/server/IntlayerServerProvider.cjs +0 -1
- package/dist/cjs/server/index.cjs +0 -1
- package/dist/cjs/server/serverContext.cjs +0 -1
- package/dist/cjs/server/t.cjs +0 -1
- package/dist/cjs/server/useDictionary.cjs +0 -1
- package/dist/cjs/server/useIntlayer.cjs +0 -1
- package/dist/esm/server/IntlayerServerProvider.mjs +0 -12
- package/dist/esm/server/index.mjs +0 -16
- package/dist/esm/server/serverContext.mjs +0 -34
- package/dist/esm/server/t.mjs +0 -10
- package/dist/esm/server/useDictionary.mjs +0 -10
- package/dist/esm/server/useIntlayer.mjs +0 -10
- package/dist/types/server/IntlayerServerProvider.d.ts +0 -38
- package/dist/types/server/IntlayerServerProvider.d.ts.map +0 -1
- package/dist/types/server/index.d.ts +0 -6
- package/dist/types/server/index.d.ts.map +0 -1
- package/dist/types/server/serverContext.d.ts +0 -35
- package/dist/types/server/serverContext.d.ts.map +0 -1
- package/dist/types/server/t.d.ts +0 -24
- package/dist/types/server/t.d.ts.map +0 -1
- package/dist/types/server/useDictionary.d.ts +0 -19
- package/dist/types/server/useDictionary.d.ts.map +0 -1
- package/dist/types/server/useIntlayer.d.ts +0 -16
- package/dist/types/server/useIntlayer.d.ts.map +0 -1
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
import { getContentNodeByKeyPath as
|
|
2
|
-
import { MessageKey as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { createSharedComposable as
|
|
5
|
-
import { useCrossFrameState as
|
|
1
|
+
import { getContentNodeByKeyPath as s } from "@intlayer/core";
|
|
2
|
+
import { MessageKey as a } from "@intlayer/editor";
|
|
3
|
+
import { ref as c, readonly as C, inject as E, watch as d } from "vue";
|
|
4
|
+
import { createSharedComposable as l } from "./createSharedComposable.mjs";
|
|
5
|
+
import { useCrossFrameState as u } from "./useCrossFrameState.mjs";
|
|
6
6
|
let o = null;
|
|
7
|
-
const
|
|
7
|
+
const i = Symbol("EditedContent"), m = () => {
|
|
8
8
|
if (o) return o;
|
|
9
|
-
const t =
|
|
9
|
+
const t = c({});
|
|
10
10
|
return o = {
|
|
11
|
-
editedContent:
|
|
11
|
+
editedContent: C(t),
|
|
12
12
|
getEditedContentValue: (e, r) => {
|
|
13
|
-
|
|
14
|
-
const n = (i = (d = t.value) == null ? void 0 : d[e]) == null ? void 0 : i.content;
|
|
13
|
+
const n = t.value?.[e]?.content;
|
|
15
14
|
if (n)
|
|
16
|
-
return
|
|
15
|
+
return s(n, r);
|
|
17
16
|
},
|
|
18
17
|
setEditedContent: (e) => {
|
|
19
18
|
t.value = e;
|
|
20
19
|
}
|
|
21
20
|
}, o;
|
|
22
|
-
},
|
|
23
|
-
const e =
|
|
24
|
-
t.provide(
|
|
25
|
-
},
|
|
26
|
-
const t =
|
|
21
|
+
}, _ = (t) => {
|
|
22
|
+
const e = m();
|
|
23
|
+
t.provide(i, e);
|
|
24
|
+
}, y = l(() => {
|
|
25
|
+
const t = E(i);
|
|
27
26
|
if (!t)
|
|
28
27
|
throw new Error("EditedContent state not found");
|
|
29
|
-
const [e, r] =
|
|
30
|
-
|
|
28
|
+
const [e, r] = u(
|
|
29
|
+
a.INTLAYER_EDITED_CONTENT_CHANGED,
|
|
31
30
|
{}
|
|
32
31
|
);
|
|
33
|
-
return
|
|
32
|
+
return d(e, (n) => {
|
|
34
33
|
t.editedContent.value = n ?? {};
|
|
35
|
-
}),
|
|
34
|
+
}), d(t, (n) => {
|
|
36
35
|
r(n.editedContent.value);
|
|
37
36
|
}), t;
|
|
38
37
|
});
|
|
39
38
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
m as createEditedContentClient,
|
|
40
|
+
_ as installEditedContent,
|
|
41
|
+
y as useEditedContent
|
|
43
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs";
|
|
2
2
|
import { installIntlayerEditor as a } from "./installIntlayerEditor.mjs";
|
|
3
3
|
export {
|
|
4
4
|
e as ContentSelectorWrapper,
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { compareUrls as
|
|
2
|
-
import { onScopeDispose as
|
|
3
|
-
import { useCommunicator as
|
|
4
|
-
const
|
|
5
|
-
let
|
|
1
|
+
import { compareUrls as u } from "@intlayer/editor";
|
|
2
|
+
import { onScopeDispose as f, getCurrentInstance as d } from "vue";
|
|
3
|
+
import { useCommunicator as p } from "./communicator.mjs";
|
|
4
|
+
const o = /* @__PURE__ */ new Map();
|
|
5
|
+
let c = !1;
|
|
6
|
+
function m(e, t) {
|
|
7
|
+
let s = o.get(e);
|
|
8
|
+
s || (s = /* @__PURE__ */ new Set(), o.set(e, s)), s.add(t);
|
|
9
|
+
}
|
|
6
10
|
function l(e, t) {
|
|
7
|
-
|
|
8
|
-
s
|
|
11
|
+
const s = o.get(e);
|
|
12
|
+
s && (s.delete(t), s.size === 0 && o.delete(e));
|
|
9
13
|
}
|
|
10
14
|
function w(e, t) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
u || window && (window.addEventListener("message", (s) => {
|
|
16
|
-
var i;
|
|
17
|
-
const { type: o, data: n, senderId: c } = s.data ?? {};
|
|
18
|
-
o && c !== t && (!e || e.includes("*") || e.some((a) => f(a, s.origin))) && ((i = r.get(o)) == null || i.forEach((a) => a(n)));
|
|
19
|
-
}), u = !0);
|
|
15
|
+
c || window && (window.addEventListener("message", (s) => {
|
|
16
|
+
const { type: n, data: i, senderId: a } = s.data ?? {};
|
|
17
|
+
n && a !== t && (!e || e.includes("*") || e.some((r) => u(r, s.origin))) && o.get(n)?.forEach((r) => r(i));
|
|
18
|
+
}), c = !0);
|
|
20
19
|
}
|
|
21
|
-
const
|
|
22
|
-
const { allowedOrigins: s, postMessage:
|
|
23
|
-
return
|
|
20
|
+
const L = (e, t) => {
|
|
21
|
+
const { allowedOrigins: s, postMessage: n, senderId: i } = p();
|
|
22
|
+
return w(s, i), t ? (m(e, t), f(() => l(e, t))) : d() || console.warn(
|
|
24
23
|
"useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."
|
|
25
|
-
), (
|
|
26
|
-
|
|
24
|
+
), (r) => {
|
|
25
|
+
n({ type: e, data: r, senderId: i });
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
28
|
export {
|
|
30
|
-
|
|
29
|
+
L as useCrossFrameMessageListener
|
|
31
30
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as d, computed as r } from "vue";
|
|
2
2
|
import { createSharedComposable as i } from "./createSharedComposable.mjs";
|
|
3
3
|
const u = i(
|
|
4
|
-
(
|
|
5
|
-
const
|
|
4
|
+
(e, t, n) => {
|
|
5
|
+
const o = d(
|
|
6
6
|
"editedContentActions",
|
|
7
7
|
null
|
|
8
8
|
);
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
9
|
+
return r(() => o?.getEditedContentValue(
|
|
10
|
+
e,
|
|
11
|
+
t
|
|
12
|
+
) ?? n);
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
export {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useCompact as o } from "./useCompact.mjs";
|
|
2
|
+
import { useCurrency as m } from "./useCurrency.mjs";
|
|
3
|
+
import { useDate as p } from "./useDate.mjs";
|
|
4
|
+
import { useList as f } from "./useList.mjs";
|
|
5
|
+
import { useNumber as a } from "./useNumber.mjs";
|
|
6
|
+
import { usePercentage as c } from "./usePercentage.mjs";
|
|
7
|
+
import { useRelativeTime as C } from "./useRelativeTime.mjs";
|
|
8
|
+
import { useUnit as g } from "./useUnit.mjs";
|
|
9
|
+
export {
|
|
10
|
+
o as useCompact,
|
|
11
|
+
m as useCurrency,
|
|
12
|
+
p as useDate,
|
|
13
|
+
f as useList,
|
|
14
|
+
a as useNumber,
|
|
15
|
+
c as usePercentage,
|
|
16
|
+
C as useRelativeTime,
|
|
17
|
+
g as useUnit
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { compact as c } from "@intlayer/core";
|
|
2
|
+
import { inject as l, computed as r } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as m } from "../client/installIntlayer.mjs";
|
|
4
|
+
const u = () => {
|
|
5
|
+
const t = l(m);
|
|
6
|
+
return r(() => {
|
|
7
|
+
const e = t.locale.value;
|
|
8
|
+
return (...o) => c(o[0], {
|
|
9
|
+
...o[1],
|
|
10
|
+
locale: o[1]?.locale ?? e
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as useCompact
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { currency as c } from "@intlayer/core";
|
|
2
|
+
import { inject as t, computed as l } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
|
|
4
|
+
const i = () => {
|
|
5
|
+
const o = t(n);
|
|
6
|
+
return l(() => {
|
|
7
|
+
const r = o.locale.value;
|
|
8
|
+
return (...e) => c(e[0], {
|
|
9
|
+
...e[1],
|
|
10
|
+
locale: e[1]?.locale ?? r
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
i as useCurrency
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { date as l } from "@intlayer/core";
|
|
2
|
+
import { inject as r, computed as c } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as a } from "../client/installIntlayer.mjs";
|
|
4
|
+
const i = () => {
|
|
5
|
+
const o = r(a);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const t = o.locale.value;
|
|
8
|
+
return (...e) => l(e[0], {
|
|
9
|
+
...e[1],
|
|
10
|
+
locale: e[1]?.locale ?? t
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
i as useDate
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { list as l } from "@intlayer/core";
|
|
2
|
+
import { inject as r, computed as c } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as i } from "../client/installIntlayer.mjs";
|
|
4
|
+
const a = () => {
|
|
5
|
+
const t = r(i);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const e = t.locale.value;
|
|
8
|
+
return (...o) => l(o[0], {
|
|
9
|
+
...o[1],
|
|
10
|
+
locale: o[1]?.locale ?? e
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as useList
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { number as t } from "@intlayer/core";
|
|
2
|
+
import { inject as l, computed as c } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as m } from "../client/installIntlayer.mjs";
|
|
4
|
+
const i = () => {
|
|
5
|
+
const o = l(m);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const r = o.locale.value;
|
|
8
|
+
return (...e) => t(e[0], {
|
|
9
|
+
...e[1],
|
|
10
|
+
locale: e[1]?.locale ?? r
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
i as useNumber
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { percentage as r } from "@intlayer/core";
|
|
2
|
+
import { inject as c, computed as l } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
|
|
4
|
+
const u = () => {
|
|
5
|
+
const o = c(n);
|
|
6
|
+
return l(() => {
|
|
7
|
+
const t = o.locale.value;
|
|
8
|
+
return (...e) => r(e[0], {
|
|
9
|
+
...e[1],
|
|
10
|
+
locale: e[1]?.locale ?? t
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as usePercentage
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { relativeTime as l } from "@intlayer/core";
|
|
2
|
+
import { inject as r, computed as c } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as i } from "../client/installIntlayer.mjs";
|
|
4
|
+
const u = () => {
|
|
5
|
+
const o = r(i);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const t = o.locale.value;
|
|
8
|
+
return (...e) => l(e[0], e[1], {
|
|
9
|
+
...e[2],
|
|
10
|
+
locale: e[2]?.locale ?? t
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as useRelativeTime
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { units as l } from "@intlayer/core";
|
|
2
|
+
import { inject as r, computed as c } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
|
|
4
|
+
const a = () => {
|
|
5
|
+
const t = r(n);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const e = t.locale.value;
|
|
8
|
+
return (...o) => l(o[0], {
|
|
9
|
+
...o[1],
|
|
10
|
+
locale: o[1]?.locale ?? e
|
|
11
|
+
});
|
|
12
|
+
}).value;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as useUnit
|
|
16
|
+
};
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { getMarkdownMetadata as u, NodeType as
|
|
2
|
-
import { h as
|
|
3
|
-
import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { getMarkdownMetadata as u, NodeType as o } from "@intlayer/core";
|
|
2
|
+
import { h as y } from "vue";
|
|
3
|
+
import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs";
|
|
4
4
|
import "./editor/installIntlayerEditor.mjs";
|
|
5
5
|
import { useMarkdown as p } from "./markdown/installIntlayerMarkdown.mjs";
|
|
6
|
-
import { renderIntlayerNode as
|
|
6
|
+
import { renderIntlayerNode as i } from "./renderIntlayerNode.mjs";
|
|
7
7
|
const b = {
|
|
8
8
|
id: "intlayer-node-plugin",
|
|
9
9
|
canHandle: (n) => typeof n == "bigint" || typeof n == "string" || typeof n == "number",
|
|
10
|
-
transform: (n, { children: t, ...r }) =>
|
|
10
|
+
transform: (n, { children: t, ...r }) => i({
|
|
11
11
|
...r,
|
|
12
12
|
value: t,
|
|
13
|
-
children: () =>
|
|
13
|
+
children: () => y(
|
|
14
14
|
// EditorSelectorRenderer, // Maximum stack size exceeded
|
|
15
15
|
l,
|
|
16
16
|
{
|
|
@@ -27,14 +27,14 @@ const b = {
|
|
|
27
27
|
canHandle: (n) => typeof n == "string",
|
|
28
28
|
transform: (n, t, r) => {
|
|
29
29
|
const {
|
|
30
|
-
plugins:
|
|
30
|
+
plugins: d,
|
|
31
31
|
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
32
32
|
...e
|
|
33
33
|
} = t, m = u(n), s = r(m, {
|
|
34
34
|
plugins: [{
|
|
35
35
|
id: "markdown-metadata-plugin",
|
|
36
36
|
canHandle: (a) => typeof a == "string" || typeof a == "number" || typeof a == "boolean" || !a,
|
|
37
|
-
transform: (a, c) =>
|
|
37
|
+
transform: (a, c) => i({
|
|
38
38
|
...c,
|
|
39
39
|
value: a,
|
|
40
40
|
children: n
|
|
@@ -43,10 +43,10 @@ const b = {
|
|
|
43
43
|
dictionaryKey: e.dictionaryKey,
|
|
44
44
|
keyPath: []
|
|
45
45
|
});
|
|
46
|
-
return
|
|
46
|
+
return i({
|
|
47
47
|
...t,
|
|
48
48
|
value: n,
|
|
49
|
-
children: () =>
|
|
49
|
+
children: () => y(
|
|
50
50
|
// EditorSelectorRenderer, // Maximum stack size exceeded
|
|
51
51
|
l,
|
|
52
52
|
{
|
|
@@ -67,18 +67,18 @@ const b = {
|
|
|
67
67
|
}
|
|
68
68
|
}, H = {
|
|
69
69
|
id: "markdown-plugin",
|
|
70
|
-
canHandle: (n) => typeof n == "object" &&
|
|
70
|
+
canHandle: (n) => typeof n == "object" && n?.nodeType === o.Markdown,
|
|
71
71
|
transform: (n, t, r) => {
|
|
72
|
-
const
|
|
72
|
+
const d = [
|
|
73
73
|
...t.keyPath,
|
|
74
74
|
{
|
|
75
|
-
type:
|
|
75
|
+
type: o.Markdown
|
|
76
76
|
}
|
|
77
|
-
], e = n[
|
|
77
|
+
], e = n[o.Markdown];
|
|
78
78
|
return r(e, {
|
|
79
79
|
...t,
|
|
80
80
|
children: e,
|
|
81
|
-
keyPath:
|
|
81
|
+
keyPath: d,
|
|
82
82
|
plugins: [f, ...t.plugins ?? []]
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { useCompact } from './useCompact';
|
|
2
|
+
export { useCurrency } from './useCurrency';
|
|
3
|
+
export { useDate } from './useDate';
|
|
4
|
+
export { useList } from './useList';
|
|
5
|
+
export { useNumber } from './useNumber';
|
|
6
|
+
export { usePercentage } from './usePercentage';
|
|
7
|
+
export { useRelativeTime } from './useRelativeTime';
|
|
8
|
+
export { useUnit } from './useUnit';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/format/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a compact number formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatCompact = useCompact();
|
|
8
|
+
* formatCompact(1500); // "1.5K"
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const useCompact: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
12
|
+
locale?: import('intlayer').LocalesValues;
|
|
13
|
+
}) | undefined) => string;
|
|
14
|
+
//# sourceMappingURL=useCompact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","sourceRoot":"","sources":["../../../src/format/useCompact.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;;yBAYtB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a currency formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatCurrency = useCurrency();
|
|
8
|
+
*
|
|
9
|
+
* formatCurrency(1500, { currency: "USD" });
|
|
10
|
+
* // "$1,500.00"
|
|
11
|
+
*
|
|
12
|
+
* formatCurrency(1500, { currency: "EUR", locale: "de-DE" });
|
|
13
|
+
* // "1.500,00 €"
|
|
14
|
+
*
|
|
15
|
+
* formatCurrency(9876543.21, {
|
|
16
|
+
* currency: "JPY",
|
|
17
|
+
* fractionDigits: 0,
|
|
18
|
+
* });
|
|
19
|
+
* // "¥9,876,543"
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const useCurrency: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
23
|
+
locale?: import('intlayer').LocalesValues;
|
|
24
|
+
}) | undefined) => string;
|
|
25
|
+
//# sourceMappingURL=useCurrency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","sourceRoot":"","sources":["../../../src/format/useCurrency.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW;;yBAYvB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a date/time formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatDate = useDate();
|
|
8
|
+
*
|
|
9
|
+
* formatDate(new Date(), "short");
|
|
10
|
+
* // e.g., "08/02/25, 14:30"
|
|
11
|
+
*
|
|
12
|
+
* formatDate("2025-08-02T14:30:00Z", {
|
|
13
|
+
* locale: "fr",
|
|
14
|
+
* month: "long",
|
|
15
|
+
* day: "numeric"
|
|
16
|
+
* });
|
|
17
|
+
* // "2 août"
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const useDate: () => (date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
|
|
21
|
+
locale?: import('intlayer').LocalesValues;
|
|
22
|
+
}) | undefined) => string;
|
|
23
|
+
//# sourceMappingURL=useDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDate.d.ts","sourceRoot":"","sources":["../../../src/format/useDate.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a list formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatList = useList();
|
|
8
|
+
*
|
|
9
|
+
* formatList(['apple', 'banana', 'orange']);
|
|
10
|
+
* // "apple, banana, and orange"
|
|
11
|
+
*
|
|
12
|
+
* formatList(['red', 'green', 'blue'], { type: 'disjunction' });
|
|
13
|
+
* // "red, green, or blue"
|
|
14
|
+
*
|
|
15
|
+
* formatList([1, 2, 3], { type: 'unit', locale: 'de-DE' });
|
|
16
|
+
* // "1, 2 und 3"
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const useList: () => (values: (string | number)[], options?: (Intl.ListFormatOptions & {
|
|
20
|
+
locale?: import('intlayer').LocalesValues;
|
|
21
|
+
}) | undefined) => string;
|
|
22
|
+
//# sourceMappingURL=useList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useList.d.ts","sourceRoot":"","sources":["../../../src/format/useList.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a localized number formatter.
|
|
3
|
+
*
|
|
4
|
+
* Uses the current locale from the IntlayerProvider and returns
|
|
5
|
+
* a function that can be used to format numbers consistently
|
|
6
|
+
* according to the user's locale.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```vue
|
|
10
|
+
* const formatNumber = useNumber();
|
|
11
|
+
*
|
|
12
|
+
* formatNumber(12345);
|
|
13
|
+
* // e.g. "12,345" (en-US)
|
|
14
|
+
* // e.g. "12 345" (fr-FR)
|
|
15
|
+
*
|
|
16
|
+
* formatNumber(0.75, { style: "percent" });
|
|
17
|
+
* // e.g. "75%"
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const useNumber: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
21
|
+
locale?: import('intlayer').LocalesValues;
|
|
22
|
+
}) | undefined) => string;
|
|
23
|
+
//# sourceMappingURL=useNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumber.d.ts","sourceRoot":"","sources":["../../../src/format/useNumber.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS;;yBAYrB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a percentage formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatPercentage = usePercentage();
|
|
8
|
+
*
|
|
9
|
+
* formatPercentage(0.25); // "25%"
|
|
10
|
+
* formatPercentage(25); // "25%"
|
|
11
|
+
* formatPercentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const usePercentage: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
15
|
+
locale?: import('intlayer').LocalesValues;
|
|
16
|
+
}) | undefined) => string;
|
|
17
|
+
//# sourceMappingURL=usePercentage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","sourceRoot":"","sources":["../../../src/format/usePercentage.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa;;yBAYzB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a relative time formatter
|
|
3
|
+
* bound to the current application locale.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```vue
|
|
7
|
+
* const formatRelativeTime = useRelativeTime();
|
|
8
|
+
*
|
|
9
|
+
* const now = new Date();
|
|
10
|
+
* const in3Days = new Date(now.getTime() + 3 * 864e5);
|
|
11
|
+
* formatRelativeTime(now, in3Days, { unit: "day" }); // "in 3 days"
|
|
12
|
+
*
|
|
13
|
+
* const twoHoursAgo = new Date(now.getTime() - 2 * 3600e3);
|
|
14
|
+
* formatRelativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 hours ago"
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date | undefined, options?: (Intl.RelativeTimeFormatOptions & {
|
|
18
|
+
locale?: import('intlayer').LocalesValues;
|
|
19
|
+
unit?: Intl.RelativeTimeFormatUnit;
|
|
20
|
+
}) | undefined) => string;
|
|
21
|
+
//# sourceMappingURL=useRelativeTime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRelativeTime.d.ts","sourceRoot":"","sources":["../../../src/format/useRelativeTime.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe;;;yBAY3B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue composable that provides a unit formatting function
|
|
3
|
+
* based on the current locale from the IntlayerProvider.
|
|
4
|
+
*
|
|
5
|
+
* This composable wraps the core units function to return a formatter
|
|
6
|
+
* that can convert values into human-readable localized units
|
|
7
|
+
* (e.g., "10 km", "5 lbs").
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```vue
|
|
11
|
+
* const formatUnit = useUnit();
|
|
12
|
+
* const distance = formatUnit(10, { unit: "kilometer" });
|
|
13
|
+
* // "10 km" (depending on locale)
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const useUnit: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
17
|
+
locale?: import('intlayer').LocalesValues;
|
|
18
|
+
}) | undefined) => string;
|
|
19
|
+
//# sourceMappingURL=useUnit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnit.d.ts","sourceRoot":"","sources":["../../../src/format/useUnit.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
|