svelte-intlayer 8.1.2 → 8.1.3
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.js +1 -1
- package/dist/client/useLocaleStorage.js +2 -1
- package/dist/client/useRewriteURL.js +1 -1
- package/dist/editor/ContentSelectorWrapper.svelte +2 -1
- package/dist/editor/ContentSelectorWrapper.svelte.d.ts +1 -1
- package/dist/getDictionary.d.ts +1 -1
- package/dist/getDictionary.js +1 -1
- package/dist/getIntlayer.d.ts +1 -1
- package/dist/getIntlayer.js +1 -1
- package/dist/html/HTMLProvider.svelte +1 -1
- package/dist/html/index.js +1 -1
- package/dist/html/types.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/markdown/MarkdownMetadataRenderer.svelte +2 -1
- package/dist/markdown/compiler.js +1 -1
- package/dist/markdown/runtime.d.ts +1 -1
- package/dist/markdown/runtime.js +1 -1
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +4 -2
- package/package.json +7 -7
package/dist/client/useIntl.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localeStorageOptions } from '@intlayer/core/localization';
|
|
2
|
+
import { getLocaleFromStorage, LocaleStorage, setLocaleInStorage as setLocaleInStorageCore, } from '@intlayer/core/utils';
|
|
2
3
|
import { readable } from 'svelte/store';
|
|
3
4
|
/**
|
|
4
5
|
* Get the locale cookie
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import configuration from '@intlayer/config/built';
|
|
2
|
-
import { getRewritePath } from '@intlayer/core';
|
|
2
|
+
import { getRewritePath } from '@intlayer/core/localization';
|
|
3
3
|
import { useLocale } from './useLocale';
|
|
4
4
|
/**
|
|
5
5
|
* Client-side hook to manage URL rewrites in Svelte without triggering a router navigation.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { NodeProps } from '@intlayer/core/interpreter';
|
|
3
|
+
import { isSameKeyPath } from '@intlayer/core/utils';
|
|
3
4
|
import { MessageKey } from '@intlayer/editor';
|
|
4
5
|
import { NodeType } from '@intlayer/types';
|
|
5
6
|
import { get } from 'svelte/store';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NodeProps } from '@intlayer/core/interpreter';
|
|
2
2
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
4
|
$$bindings?: Bindings;
|
package/dist/getDictionary.d.ts
CHANGED
package/dist/getDictionary.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDictionary as getDictionaryCore, } from '@intlayer/core';
|
|
1
|
+
import { getDictionary as getDictionaryCore, } from '@intlayer/core/interpreter';
|
|
2
2
|
import { htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, svelteNodePlugins, } from './plugins';
|
|
3
3
|
/**
|
|
4
4
|
* Get dictionary content for a specific locale in Svelte applications
|
package/dist/getIntlayer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Plugins } from '@intlayer/core';
|
|
1
|
+
import { type Plugins } from '@intlayer/core/interpreter';
|
|
2
2
|
import type { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
|
|
3
3
|
import { type DeepTransformContent } from './plugins';
|
|
4
4
|
/**
|
package/dist/getIntlayer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getIntlayer as getIntlayerCore } from '@intlayer/core';
|
|
1
|
+
import { getIntlayer as getIntlayerCore, } from '@intlayer/core/interpreter';
|
|
2
2
|
import { htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, svelteNodePlugins, } from './plugins';
|
|
3
3
|
/**
|
|
4
4
|
* Get dictionary content by key for Svelte applications
|
package/dist/html/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './context';
|
|
2
2
|
export { default as HTMLProvider } from './HTMLProvider.svelte';
|
|
3
3
|
export { default as HTMLRenderer } from './HTMLRenderer.svelte';
|
|
4
|
-
import { getHTML } from '@intlayer/core';
|
|
4
|
+
import { getHTML } from '@intlayer/core/interpreter';
|
|
5
5
|
import { getHTMLContext } from './context';
|
|
6
6
|
export const renderHTML = (html, options = {}) => {
|
|
7
7
|
return getHTML(html, (options.components || {}));
|
package/dist/html/types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LocalesValues } from '@intlayer/types';
|
|
2
2
|
import type { IInterpreterPluginSvelte } from './plugins';
|
|
3
|
-
declare module '@intlayer/core' {
|
|
3
|
+
declare module '@intlayer/core/interpreter' {
|
|
4
4
|
interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginSvelte<T, S, L> {
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getContentNodeByKeyPath
|
|
2
|
+
import { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';
|
|
3
|
+
import { getMarkdownMetadata } from '@intlayer/core/markdown';
|
|
3
4
|
import type { ContentNode, KeyPath, Locale } from '@intlayer/types';
|
|
4
5
|
import { useLocale } from '../client/useLocale';
|
|
5
6
|
|
package/dist/markdown/runtime.js
CHANGED
|
@@ -58,7 +58,7 @@ export const svelteHtmlRuntime = {
|
|
|
58
58
|
}
|
|
59
59
|
return `<${tagName}${attributes}>${childrenStr}</${tagName}>`;
|
|
60
60
|
},
|
|
61
|
-
cloneElement: (element,
|
|
61
|
+
cloneElement: (element, _props) => {
|
|
62
62
|
// Basic implementation: if it's an HTML string, we can't easily merge props
|
|
63
63
|
// without re-parsing. For now, just return as is or wrap if needed.
|
|
64
64
|
return String(element);
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeepTransformContent as DeepTransformContentCore, type IInterpreterPluginState as IInterpreterPluginStateCore, type Plugins } from '@intlayer/core';
|
|
1
|
+
import { type DeepTransformContent as DeepTransformContentCore, type IInterpreterPluginState as IInterpreterPluginStateCore, type Plugins } from '@intlayer/core/interpreter';
|
|
2
2
|
import { type DeclaredLocales, type LocalesValues, NodeType } from '@intlayer/types';
|
|
3
3
|
import type { HTMLComponents } from './html/types';
|
|
4
4
|
import { type IntlayerNode } from './renderIntlayerNode';
|
|
@@ -48,9 +48,9 @@ export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
|
|
|
48
48
|
}> : never;
|
|
49
49
|
/** Markdown string plugin. Replaces string node with a component that render the markdown. */
|
|
50
50
|
export declare const markdownStringPlugin: Plugins;
|
|
51
|
-
export type MarkdownCond<T,
|
|
51
|
+
export type MarkdownCond<T, _S, L extends LocalesValues> = T extends {
|
|
52
52
|
nodeType: NodeType | string;
|
|
53
|
-
[NodeType.Markdown]: infer
|
|
53
|
+
[NodeType.Markdown]: infer _M;
|
|
54
54
|
metadata?: infer U;
|
|
55
55
|
tags?: infer U;
|
|
56
56
|
} ? {
|
package/dist/plugins.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getHTML, } from '@intlayer/core/interpreter';
|
|
2
|
+
import { compile, getMarkdownMetadata } from '@intlayer/core/markdown';
|
|
3
|
+
import { HTML_TAGS, } from '@intlayer/core/transpiler';
|
|
2
4
|
import { NodeType, } from '@intlayer/types';
|
|
3
5
|
import { ContentSelectorWrapper } from './editor';
|
|
4
6
|
import MarkdownMetadataWithSelector from './markdown/MarkdownMetadataWithSelector.svelte';
|
|
@@ -250,7 +252,7 @@ export const htmlPlugin = {
|
|
|
250
252
|
canHandle: (node) => typeof node === 'object' && node?.nodeType === NodeType.HTML,
|
|
251
253
|
transform: (node) => {
|
|
252
254
|
const htmlString = node[NodeType.HTML];
|
|
253
|
-
const
|
|
255
|
+
const _tags = node.tags ?? [];
|
|
254
256
|
const render = (userComponents) => {
|
|
255
257
|
const mergedComponents = {
|
|
256
258
|
...getDefaultHTMLComponents(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-intlayer",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"description": "Easily internationalize i18n your Svelte applications with type-safe multilingual content management.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intlayer",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@intlayer/api": "8.1.
|
|
77
|
-
"@intlayer/config": "8.1.
|
|
78
|
-
"@intlayer/core": "8.1.
|
|
79
|
-
"@intlayer/editor": "8.1.
|
|
80
|
-
"@intlayer/types": "8.1.
|
|
81
|
-
"@intlayer/unmerged-dictionaries-entry": "8.1.
|
|
76
|
+
"@intlayer/api": "8.1.3",
|
|
77
|
+
"@intlayer/config": "8.1.3",
|
|
78
|
+
"@intlayer/core": "8.1.3",
|
|
79
|
+
"@intlayer/editor": "8.1.3",
|
|
80
|
+
"@intlayer/types": "8.1.3",
|
|
81
|
+
"@intlayer/unmerged-dictionaries-entry": "8.1.3"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@sveltejs/adapter-auto": "7.0.0",
|