svelte-intlayer 8.4.0 → 8.4.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.
- package/dist/client/useIntl.d.ts +2 -59
- package/dist/editor/useEditor.js +1 -1
- package/dist/plugins.js +8 -2
- package/package.json +6 -6
package/dist/client/useIntl.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WrappedIntl } from '@intlayer/core/formatters';
|
|
1
2
|
import type { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
3
|
/**
|
|
3
4
|
* Svelte hook that provides a locale-bound `Intl` object.
|
|
@@ -21,62 +22,4 @@ import type { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
|
21
22
|
* </script>
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
|
-
export declare const useIntl: (locale?: LocalesValues) => import("svelte/store").Readable<
|
|
25
|
-
Collator: {
|
|
26
|
-
new (locales?: LocalesValues, options?: Intl.CollatorOptions | undefined): Intl.Collator;
|
|
27
|
-
new (options?: (Intl.CollatorOptions & {
|
|
28
|
-
locale?: LocalesValues;
|
|
29
|
-
}) | undefined): Intl.Collator;
|
|
30
|
-
};
|
|
31
|
-
NumberFormat: {
|
|
32
|
-
new (locales?: LocalesValues, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat;
|
|
33
|
-
new (options?: (Intl.NumberFormatOptions & {
|
|
34
|
-
locale?: LocalesValues;
|
|
35
|
-
}) | undefined): Intl.NumberFormat;
|
|
36
|
-
};
|
|
37
|
-
DateTimeFormat: {
|
|
38
|
-
new (locales?: LocalesValues, options?: Intl.DateTimeFormatOptions | undefined): Intl.DateTimeFormat;
|
|
39
|
-
new (options?: (Intl.DateTimeFormatOptions & {
|
|
40
|
-
locale?: LocalesValues;
|
|
41
|
-
}) | undefined): Intl.DateTimeFormat;
|
|
42
|
-
};
|
|
43
|
-
getCanonicalLocales: typeof Intl.getCanonicalLocales;
|
|
44
|
-
readonly PluralRules: {
|
|
45
|
-
new (locales?: LocalesValues, options?: Intl.PluralRulesOptions | undefined): Intl.PluralRules;
|
|
46
|
-
new (options?: (Intl.PluralRulesOptions & {
|
|
47
|
-
locale?: LocalesValues;
|
|
48
|
-
}) | undefined): Intl.PluralRules;
|
|
49
|
-
};
|
|
50
|
-
readonly RelativeTimeFormat: {
|
|
51
|
-
new (locales?: LocalesValues, options?: Intl.RelativeTimeFormatOptions | undefined): Intl.RelativeTimeFormat;
|
|
52
|
-
new (options?: (Intl.RelativeTimeFormatOptions & {
|
|
53
|
-
locale?: LocalesValues;
|
|
54
|
-
}) | undefined): Intl.RelativeTimeFormat;
|
|
55
|
-
};
|
|
56
|
-
readonly Locale: {
|
|
57
|
-
new (locales?: LocalesValues, options?: Intl.LocaleOptions | undefined): Intl.Locale;
|
|
58
|
-
new (options?: (Intl.LocaleOptions & {
|
|
59
|
-
locale?: LocalesValues;
|
|
60
|
-
}) | undefined): Intl.Locale;
|
|
61
|
-
};
|
|
62
|
-
readonly DisplayNames: {
|
|
63
|
-
prototype: Intl.DisplayNames;
|
|
64
|
-
new (locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions): Intl.DisplayNames;
|
|
65
|
-
supportedLocalesOf(locales?: Intl.LocalesArgument, options?: {
|
|
66
|
-
localeMatcher?: Intl.RelativeTimeFormatLocaleMatcher;
|
|
67
|
-
}): Intl.UnicodeBCP47LocaleIdentifier[];
|
|
68
|
-
};
|
|
69
|
-
readonly ListFormat: {
|
|
70
|
-
new (locales?: LocalesValues, options?: Intl.ListFormatOptions | undefined): Intl.ListFormat;
|
|
71
|
-
new (options?: (Intl.ListFormatOptions & {
|
|
72
|
-
locale?: LocalesValues;
|
|
73
|
-
}) | undefined): Intl.ListFormat;
|
|
74
|
-
};
|
|
75
|
-
supportedValuesOf: typeof Intl.supportedValuesOf;
|
|
76
|
-
readonly Segmenter: {
|
|
77
|
-
new (locales?: LocalesValues, options?: Intl.SegmenterOptions | undefined): Intl.Segmenter;
|
|
78
|
-
new (options?: (Intl.SegmenterOptions & {
|
|
79
|
-
locale?: LocalesValues;
|
|
80
|
-
}) | undefined): Intl.Segmenter;
|
|
81
|
-
};
|
|
82
|
-
}>;
|
|
25
|
+
export declare const useIntl: (locale?: LocalesValues) => import("svelte/store").Readable<WrappedIntl>;
|
package/dist/editor/useEditor.js
CHANGED
|
@@ -11,7 +11,7 @@ import { intlayerStore } from '../client/intlayerStore';
|
|
|
11
11
|
* direct access to the Svelte 5 rune state.
|
|
12
12
|
*/
|
|
13
13
|
export const useEditor = () => {
|
|
14
|
-
if (!isEnabled)
|
|
14
|
+
if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled)
|
|
15
15
|
return;
|
|
16
16
|
let unsubscribeLocale = null;
|
|
17
17
|
onMount(() => {
|
package/dist/plugins.js
CHANGED
|
@@ -4,7 +4,9 @@ import { compile, getMarkdownMetadata } from '@intlayer/core/markdown';
|
|
|
4
4
|
import { HTML_TAGS, } from '@intlayer/core/transpiler';
|
|
5
5
|
import { NodeType } from '@intlayer/types/nodeType';
|
|
6
6
|
import { default as ContentSelector } from './editor/ContentSelector.svelte';
|
|
7
|
+
import MarkdownMetadataRenderer from './markdown/MarkdownMetadataRenderer.svelte';
|
|
7
8
|
import MarkdownMetadataWithSelector from './markdown/MarkdownMetadataWithSelector.svelte';
|
|
9
|
+
import MarkdownRenderer from './markdown/MarkdownRenderer.svelte';
|
|
8
10
|
import MarkdownWithSelector from './markdown/MarkdownWithSelector.svelte';
|
|
9
11
|
import { svelteHtmlRuntime } from './markdown/runtime';
|
|
10
12
|
import { renderIntlayerNode } from './renderIntlayerNode';
|
|
@@ -136,7 +138,9 @@ export const markdownStringPlugin = {
|
|
|
136
138
|
!metadataNode,
|
|
137
139
|
transform: (metadataNode, props) => renderIntlayerNode({
|
|
138
140
|
value: metadataNode,
|
|
139
|
-
component:
|
|
141
|
+
component: configuration?.editor.enabled
|
|
142
|
+
? MarkdownMetadataWithSelector
|
|
143
|
+
: MarkdownMetadataRenderer,
|
|
140
144
|
props: {
|
|
141
145
|
...rest,
|
|
142
146
|
value: node, // The full markdown string
|
|
@@ -153,7 +157,9 @@ export const markdownStringPlugin = {
|
|
|
153
157
|
const render = (components) => {
|
|
154
158
|
const nodeResult = renderIntlayerNode({
|
|
155
159
|
value: node,
|
|
156
|
-
component:
|
|
160
|
+
component: configuration?.editor.enabled
|
|
161
|
+
? MarkdownWithSelector
|
|
162
|
+
: MarkdownRenderer,
|
|
157
163
|
props: {
|
|
158
164
|
...rest,
|
|
159
165
|
value: node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-intlayer",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.2",
|
|
4
4
|
"description": "Easily internationalize i18n your Svelte applications with type-safe multilingual content management.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intlayer",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@intlayer/api": "8.4.
|
|
76
|
-
"@intlayer/config": "8.4.
|
|
77
|
-
"@intlayer/core": "8.4.
|
|
78
|
-
"@intlayer/editor": "8.4.
|
|
79
|
-
"@intlayer/types": "8.4.
|
|
75
|
+
"@intlayer/api": "8.4.2",
|
|
76
|
+
"@intlayer/config": "8.4.2",
|
|
77
|
+
"@intlayer/core": "8.4.2",
|
|
78
|
+
"@intlayer/editor": "8.4.2",
|
|
79
|
+
"@intlayer/types": "8.4.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@sveltejs/adapter-auto": "7.0.1",
|