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.
@@ -1,4 +1,4 @@
1
- import { bindIntl } from '@intlayer/core';
1
+ import { bindIntl } from '@intlayer/core/formatters';
2
2
  import { derived } from 'svelte/store';
3
3
  import { useLocale } from './useLocale';
4
4
  /**
@@ -1,4 +1,5 @@
1
- import { getLocaleFromStorage, LocaleStorage, localeStorageOptions, setLocaleInStorage as setLocaleInStorageCore, } from '@intlayer/core';
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 { isSameKeyPath, type NodeProps } from '@intlayer/core';
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 { type NodeProps } from '@intlayer/core';
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;
@@ -1,4 +1,4 @@
1
- import { type Plugins } from '@intlayer/core';
1
+ import { type Plugins } from '@intlayer/core/interpreter';
2
2
  import type { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
3
3
  import { type DeepTransformContent } from './plugins';
4
4
  /**
@@ -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
@@ -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
  /**
@@ -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
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { getHTML } from '@intlayer/core';
2
+ import { getHTML } from '@intlayer/core/interpreter';
3
3
  import { setHTMLContext } from './context';
4
4
  import type { HTMLComponents } from './types';
5
5
 
@@ -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 || {}));
@@ -1,4 +1,4 @@
1
- import type { HTMLTagsType } from '@intlayer/core';
1
+ import type { HTMLTagsType } from '@intlayer/core/transpiler';
2
2
  import type { Component } from 'svelte';
3
3
  /**
4
4
  * Helper to extract specific props from the configuration value.
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, getMarkdownMetadata } from '@intlayer/core';
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
 
@@ -1,4 +1,4 @@
1
- import { compileWithOptions } from '@intlayer/core';
1
+ import { compileWithOptions } from '@intlayer/core/markdown';
2
2
  import { svelteHtmlRuntime } from './runtime';
3
3
  /**
4
4
  * Compile markdown to HTML strings for Svelte.
@@ -1,4 +1,4 @@
1
- import type { MarkdownRuntime } from '@intlayer/core';
1
+ import type { MarkdownRuntime } from '@intlayer/core/markdown';
2
2
  /**
3
3
  * Svelte-specific runtime for the markdown processor.
4
4
  * Renders markdown to HTML strings since Svelte uses {@html ...} for dynamic HTML.
@@ -58,7 +58,7 @@ export const svelteHtmlRuntime = {
58
58
  }
59
59
  return `<${tagName}${attributes}>${childrenStr}</${tagName}>`;
60
60
  },
61
- cloneElement: (element, props) => {
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, S, L extends LocalesValues> = T extends {
51
+ export type MarkdownCond<T, _S, L extends LocalesValues> = T extends {
52
52
  nodeType: NodeType | string;
53
- [NodeType.Markdown]: infer M;
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 { compile, getHTML, getMarkdownMetadata, HTML_TAGS, } from '@intlayer/core';
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 tags = node.tags ?? [];
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.2",
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.2",
77
- "@intlayer/config": "8.1.2",
78
- "@intlayer/core": "8.1.2",
79
- "@intlayer/editor": "8.1.2",
80
- "@intlayer/types": "8.1.2",
81
- "@intlayer/unmerged-dictionaries-entry": "8.1.2"
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",