intlayer-editor 2.1.11 → 3.0.1

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.
Files changed (153) hide show
  1. package/README.md +9 -9
  2. package/dist/cjs/{client/ContentEditionLayout.cjs → ContentEditionLayout.cjs} +2 -2
  3. package/dist/cjs/ContentEditionLayout.cjs.map +1 -0
  4. package/dist/cjs/{client/ContentEditorProvider.cjs → ContentEditorProvider.cjs} +9 -1
  5. package/dist/cjs/ContentEditorProvider.cjs.map +1 -0
  6. package/dist/cjs/{client/ContentSelectorWrapper.cjs → ContentSelectorWrapper.cjs} +8 -10
  7. package/dist/cjs/ContentSelectorWrapper.cjs.map +1 -0
  8. package/dist/cjs/{client/DictionaryEditionDrawer → DictionaryEditionDrawer}/DictionaryEditionDrawer.cjs +48 -39
  9. package/dist/cjs/DictionaryEditionDrawer/DictionaryEditionDrawer.cjs.map +1 -0
  10. package/dist/cjs/{client/DictionaryEditionDrawer → DictionaryEditionDrawer}/index.cjs +1 -3
  11. package/dist/cjs/DictionaryEditionDrawer/index.cjs.map +1 -0
  12. package/dist/cjs/{client/DictionaryEditionDrawer → DictionaryEditionDrawer}/useDictionaryEditionDrawer.cjs +12 -9
  13. package/dist/cjs/DictionaryEditionDrawer/useDictionaryEditionDrawer.cjs.map +1 -0
  14. package/dist/cjs/{client/DictionaryListDrawer → DictionaryListDrawer}/DictionaryListDrawer.cjs +16 -23
  15. package/dist/cjs/DictionaryListDrawer/DictionaryListDrawer.cjs.map +1 -0
  16. package/dist/cjs/DictionaryListDrawer/index.cjs.map +1 -0
  17. package/dist/cjs/DictionaryListDrawer/useDictionaryListDrawer.cjs.map +1 -0
  18. package/dist/cjs/index.cjs.map +1 -0
  19. package/dist/cjs/{client/renderContentEditor.cjs → renderContentEditor.cjs} +10 -4
  20. package/dist/cjs/renderContentEditor.cjs.map +1 -0
  21. package/dist/cjs/{client/useEditorServer.cjs → useEditorServer.cjs} +4 -4
  22. package/dist/cjs/useEditorServer.cjs.map +1 -0
  23. package/dist/esm/{client/ContentEditionLayout.mjs → ContentEditionLayout.mjs} +2 -2
  24. package/dist/esm/ContentEditionLayout.mjs.map +1 -0
  25. package/dist/esm/{client/ContentEditorProvider.mjs → ContentEditorProvider.mjs} +11 -2
  26. package/dist/esm/ContentEditorProvider.mjs.map +1 -0
  27. package/dist/esm/{client/ContentSelectorWrapper.mjs → ContentSelectorWrapper.mjs} +14 -11
  28. package/dist/esm/ContentSelectorWrapper.mjs.map +1 -0
  29. package/dist/esm/DictionaryEditionDrawer/DictionaryEditionDrawer.mjs +128 -0
  30. package/dist/esm/DictionaryEditionDrawer/DictionaryEditionDrawer.mjs.map +1 -0
  31. package/dist/esm/{client/DictionaryEditionDrawer → DictionaryEditionDrawer}/index.mjs +0 -1
  32. package/dist/esm/DictionaryEditionDrawer/index.mjs.map +1 -0
  33. package/dist/esm/{client/DictionaryEditionDrawer → DictionaryEditionDrawer}/useDictionaryEditionDrawer.mjs +10 -6
  34. package/dist/esm/DictionaryEditionDrawer/useDictionaryEditionDrawer.mjs.map +1 -0
  35. package/dist/esm/{client/DictionaryListDrawer → DictionaryListDrawer}/DictionaryListDrawer.mjs +17 -13
  36. package/dist/esm/DictionaryListDrawer/DictionaryListDrawer.mjs.map +1 -0
  37. package/dist/esm/DictionaryListDrawer/index.mjs.map +1 -0
  38. package/dist/esm/DictionaryListDrawer/useDictionaryListDrawer.mjs.map +1 -0
  39. package/dist/esm/index.mjs.map +1 -0
  40. package/dist/esm/{client/renderContentEditor.mjs → renderContentEditor.mjs} +10 -4
  41. package/dist/esm/renderContentEditor.mjs.map +1 -0
  42. package/dist/esm/{client/useEditorServer.mjs → useEditorServer.mjs} +3 -3
  43. package/dist/esm/useEditorServer.mjs.map +1 -0
  44. package/dist/types/ContentEditionLayout.d.ts +11 -0
  45. package/dist/types/ContentEditionLayout.d.ts.map +1 -0
  46. package/dist/types/ContentEditorProvider.d.ts +21 -0
  47. package/dist/types/ContentEditorProvider.d.ts.map +1 -0
  48. package/dist/types/ContentSelectorWrapper.d.ts +11 -0
  49. package/dist/types/ContentSelectorWrapper.d.ts.map +1 -0
  50. package/dist/types/DictionaryEditionDrawer/DictionaryEditionDrawer.d.ts +21 -0
  51. package/dist/types/DictionaryEditionDrawer/DictionaryEditionDrawer.d.ts.map +1 -0
  52. package/dist/types/DictionaryEditionDrawer/index.d.ts +3 -0
  53. package/dist/types/DictionaryEditionDrawer/index.d.ts.map +1 -0
  54. package/dist/types/DictionaryEditionDrawer/useDictionaryEditionDrawer.d.ts +31 -0
  55. package/dist/types/DictionaryEditionDrawer/useDictionaryEditionDrawer.d.ts.map +1 -0
  56. package/dist/types/DictionaryListDrawer/DictionaryListDrawer.d.ts +3 -0
  57. package/dist/types/DictionaryListDrawer/DictionaryListDrawer.d.ts.map +1 -0
  58. package/dist/types/DictionaryListDrawer/index.d.ts +3 -0
  59. package/dist/types/DictionaryListDrawer/index.d.ts.map +1 -0
  60. package/dist/types/DictionaryListDrawer/useDictionaryListDrawer.d.ts +7 -0
  61. package/dist/types/DictionaryListDrawer/useDictionaryListDrawer.d.ts.map +1 -0
  62. package/dist/types/index.d.ts +7 -0
  63. package/dist/types/index.d.ts.map +1 -0
  64. package/dist/types/renderContentEditor.d.ts +14 -0
  65. package/dist/types/renderContentEditor.d.ts.map +1 -0
  66. package/dist/types/useEditorServer.d.ts +4 -0
  67. package/dist/types/useEditorServer.d.ts.map +1 -0
  68. package/package.json +39 -35
  69. package/dist/cjs/client/ContentEditionLayout.cjs.map +0 -1
  70. package/dist/cjs/client/ContentEditionLayout.d.ts +0 -13
  71. package/dist/cjs/client/ContentEditorProvider.cjs.map +0 -1
  72. package/dist/cjs/client/ContentEditorProvider.d.ts +0 -23
  73. package/dist/cjs/client/ContentSelectorWrapper.cjs.map +0 -1
  74. package/dist/cjs/client/ContentSelectorWrapper.d.ts +0 -12
  75. package/dist/cjs/client/DictionaryEditionDrawer/DictionaryEditionDrawer.cjs.map +0 -1
  76. package/dist/cjs/client/DictionaryEditionDrawer/DictionaryEditionDrawer.d.ts +0 -28
  77. package/dist/cjs/client/DictionaryEditionDrawer/index.cjs.map +0 -1
  78. package/dist/cjs/client/DictionaryEditionDrawer/index.d.ts +0 -9
  79. package/dist/cjs/client/DictionaryEditionDrawer/useDictionaryEditionDrawer.cjs.map +0 -1
  80. package/dist/cjs/client/DictionaryEditionDrawer/useDictionaryEditionDrawer.d.ts +0 -32
  81. package/dist/cjs/client/DictionaryEditionDrawer/useEditedContentStore.cjs +0 -98
  82. package/dist/cjs/client/DictionaryEditionDrawer/useEditedContentStore.cjs.map +0 -1
  83. package/dist/cjs/client/DictionaryEditionDrawer/useEditedContentStore.d.ts +0 -28
  84. package/dist/cjs/client/DictionaryEditionDrawer/useFocusContentStore.cjs +0 -33
  85. package/dist/cjs/client/DictionaryEditionDrawer/useFocusContentStore.cjs.map +0 -1
  86. package/dist/cjs/client/DictionaryEditionDrawer/useFocusContentStore.d.ts +0 -16
  87. package/dist/cjs/client/DictionaryListDrawer/DictionaryListDrawer.cjs.map +0 -1
  88. package/dist/cjs/client/DictionaryListDrawer/DictionaryListDrawer.d.ts +0 -5
  89. package/dist/cjs/client/DictionaryListDrawer/index.cjs.map +0 -1
  90. package/dist/cjs/client/DictionaryListDrawer/index.d.ts +0 -3
  91. package/dist/cjs/client/DictionaryListDrawer/useDictionaryListDrawer.cjs.map +0 -1
  92. package/dist/cjs/client/DictionaryListDrawer/useDictionaryListDrawer.d.ts +0 -8
  93. package/dist/cjs/client/index.cjs.map +0 -1
  94. package/dist/cjs/client/index.d.ts +0 -15
  95. package/dist/cjs/client/renderContentEditor.cjs.map +0 -1
  96. package/dist/cjs/client/renderContentEditor.d.ts +0 -15
  97. package/dist/cjs/client/useEditorServer.cjs.map +0 -1
  98. package/dist/cjs/client/useEditorServer.d.ts +0 -5
  99. package/dist/cjs/server/formatPrettier.cjs +0 -51
  100. package/dist/cjs/server/formatPrettier.cjs.map +0 -1
  101. package/dist/cjs/server/formatPrettier.d.ts +0 -6
  102. package/dist/cjs/server/index.cjs +0 -68
  103. package/dist/cjs/server/index.cjs.map +0 -1
  104. package/dist/cjs/server/index.d.ts +0 -3
  105. package/dist/cjs/server/processEdition.cjs +0 -157
  106. package/dist/cjs/server/processEdition.cjs.map +0 -1
  107. package/dist/cjs/server/processEdition.d.ts +0 -12
  108. package/dist/esm/client/ContentEditionLayout.d.mts +0 -13
  109. package/dist/esm/client/ContentEditionLayout.mjs.map +0 -1
  110. package/dist/esm/client/ContentEditorProvider.d.mts +0 -23
  111. package/dist/esm/client/ContentEditorProvider.mjs.map +0 -1
  112. package/dist/esm/client/ContentSelectorWrapper.d.mts +0 -12
  113. package/dist/esm/client/ContentSelectorWrapper.mjs.map +0 -1
  114. package/dist/esm/client/DictionaryEditionDrawer/DictionaryEditionDrawer.d.mts +0 -28
  115. package/dist/esm/client/DictionaryEditionDrawer/DictionaryEditionDrawer.mjs +0 -104
  116. package/dist/esm/client/DictionaryEditionDrawer/DictionaryEditionDrawer.mjs.map +0 -1
  117. package/dist/esm/client/DictionaryEditionDrawer/index.d.mts +0 -9
  118. package/dist/esm/client/DictionaryEditionDrawer/index.mjs.map +0 -1
  119. package/dist/esm/client/DictionaryEditionDrawer/useDictionaryEditionDrawer.d.mts +0 -32
  120. package/dist/esm/client/DictionaryEditionDrawer/useDictionaryEditionDrawer.mjs.map +0 -1
  121. package/dist/esm/client/DictionaryEditionDrawer/useEditedContentStore.d.mts +0 -28
  122. package/dist/esm/client/DictionaryEditionDrawer/useEditedContentStore.mjs +0 -74
  123. package/dist/esm/client/DictionaryEditionDrawer/useEditedContentStore.mjs.map +0 -1
  124. package/dist/esm/client/DictionaryEditionDrawer/useFocusContentStore.d.mts +0 -16
  125. package/dist/esm/client/DictionaryEditionDrawer/useFocusContentStore.mjs +0 -9
  126. package/dist/esm/client/DictionaryEditionDrawer/useFocusContentStore.mjs.map +0 -1
  127. package/dist/esm/client/DictionaryListDrawer/DictionaryListDrawer.d.mts +0 -5
  128. package/dist/esm/client/DictionaryListDrawer/DictionaryListDrawer.mjs.map +0 -1
  129. package/dist/esm/client/DictionaryListDrawer/index.d.mts +0 -3
  130. package/dist/esm/client/DictionaryListDrawer/index.mjs.map +0 -1
  131. package/dist/esm/client/DictionaryListDrawer/useDictionaryListDrawer.d.mts +0 -8
  132. package/dist/esm/client/DictionaryListDrawer/useDictionaryListDrawer.mjs.map +0 -1
  133. package/dist/esm/client/index.d.mts +0 -15
  134. package/dist/esm/client/index.mjs.map +0 -1
  135. package/dist/esm/client/renderContentEditor.d.mts +0 -15
  136. package/dist/esm/client/renderContentEditor.mjs.map +0 -1
  137. package/dist/esm/client/useEditorServer.d.mts +0 -5
  138. package/dist/esm/client/useEditorServer.mjs.map +0 -1
  139. package/dist/esm/server/formatPrettier.d.mts +0 -6
  140. package/dist/esm/server/formatPrettier.mjs +0 -17
  141. package/dist/esm/server/formatPrettier.mjs.map +0 -1
  142. package/dist/esm/server/index.d.mts +0 -3
  143. package/dist/esm/server/index.mjs +0 -34
  144. package/dist/esm/server/index.mjs.map +0 -1
  145. package/dist/esm/server/processEdition.d.mts +0 -12
  146. package/dist/esm/server/processEdition.mjs +0 -134
  147. package/dist/esm/server/processEdition.mjs.map +0 -1
  148. /package/dist/cjs/{client/DictionaryListDrawer → DictionaryListDrawer}/index.cjs +0 -0
  149. /package/dist/cjs/{client/DictionaryListDrawer → DictionaryListDrawer}/useDictionaryListDrawer.cjs +0 -0
  150. /package/dist/cjs/{client/index.cjs → index.cjs} +0 -0
  151. /package/dist/esm/{client/DictionaryListDrawer → DictionaryListDrawer}/index.mjs +0 -0
  152. /package/dist/esm/{client/DictionaryListDrawer → DictionaryListDrawer}/useDictionaryListDrawer.mjs +0 -0
  153. /package/dist/esm/{client/index.mjs → index.mjs} +0 -0
@@ -0,0 +1,14 @@
1
+ import type { KeyPath } from '@intlayer/core';
2
+ import type { ReactNode } from 'react';
3
+ export type IntlayerEditorElementProps = {
4
+ content: string;
5
+ dictionaryId: string;
6
+ dictionaryPath: string;
7
+ keyPath: KeyPath[];
8
+ isContentSelectable: boolean;
9
+ };
10
+ export type RenderIntlayerEditorResult = ReactNode & {
11
+ value: string;
12
+ };
13
+ export declare const renderIntlayerEditor: (data: IntlayerEditorElementProps, isContentSelectable: boolean) => RenderIntlayerEditorResult;
14
+ //# sourceMappingURL=renderContentEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderContentEditor.d.ts","sourceRoot":"","sources":["../../src/client/renderContentEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAeF,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,oBAAoB,SACzB,0BAA0B,uBACX,OAAO,KAC3B,0BASF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const useEditorServer: () => {
2
+ editContentRequest: () => Promise<void>;
3
+ };
4
+ //# sourceMappingURL=useEditorServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditorServer.d.ts","sourceRoot":"","sources":["../../src/client/useEditorServer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;CA8B3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "2.1.11",
3
+ "version": "3.0.1",
4
4
  "private": false,
5
5
  "description": "IntLayer Editor is a tool that allow you to edit your IntLayer declaration files using a graphical interface.",
6
6
  "keywords": [
@@ -14,39 +14,35 @@
14
14
  ],
15
15
  "homepage": "https://intlayer.org",
16
16
  "bugs": {
17
- "url": "https://github.com/aypineau/intlayer/issues"
17
+ "url": "https://github.com/aymericzip/intlayer/issues"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/aypineau/intlayer.git"
21
+ "url": "git+https://github.com/aymericzip/intlayer.git"
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "author": {
25
25
  "name": "Aymeric PINEAU",
26
- "url": "https://github.com/aypineau"
26
+ "url": "https://github.com/aymericzip"
27
27
  },
28
28
  "contributors": [
29
29
  {
30
30
  "name": "Aymeric Pineau",
31
31
  "email": "ay.pineau@gmail.com",
32
- "url": "https://github.com/aypineau"
32
+ "url": "https://github.com/aymericzip"
33
33
  }
34
34
  ],
35
35
  "exports": {
36
- "./client": {
37
- "types": "./dist/esm/client/index.d.mts",
38
- "require": "./dist/cjs/client/index.cjs",
39
- "import": "./dist/esm/client/index.mjs"
40
- },
41
- "./server": {
42
- "types": "./dist/esm/server/index.d.mts",
43
- "require": "./dist/cjs/server/index.cjs",
44
- "import": "./dist/esm/server/index.mjs"
36
+ ".": {
37
+ "types": "./dist/types/index.d.ts",
38
+ "require": "./dist/cjs/index.cjs",
39
+ "import": "./dist/esm/index.mjs"
45
40
  },
46
41
  "./package.json": "./package.json"
47
42
  },
48
- "main": "dist/cjs/client/index.cjs",
49
- "module": "dist/esm/client/index.mjs",
43
+ "main": "dist/cjs/index.cjs",
44
+ "module": "dist/esm/index.mjs",
45
+ "types": "dist/types/index.d.ts",
50
46
  "typesVersions": {
51
47
  "*": {
52
48
  "package.json": [
@@ -64,20 +60,20 @@
64
60
  ],
65
61
  "dependencies": {
66
62
  "@types/body-parser": "^1.19.5",
67
- "body-parser": "^1.20.2",
63
+ "body-parser": "^1.20.3",
68
64
  "commander": "^12.1.0",
69
- "express": "^4.19.2",
70
- "lucide-react": "^0.376.0",
65
+ "express": "^4.21.0",
66
+ "lucide-react": "^0.441.0",
71
67
  "magic-regexp": "^0.8.0",
72
68
  "react": "^18.3.1",
73
69
  "react-dom": "^18.3.1",
74
70
  "webpack": "^5.92.1",
75
71
  "zustand": "^4.5.2",
76
- "@intlayer/config": "^2.0.12",
77
- "@intlayer/core": "^2.0.12",
78
- "@intlayer/design-system": "^2.0.12",
79
- "@intlayer/dictionaries-entry": "^2.0.12",
80
- "intlayer": "^2.0.12"
72
+ "@intlayer/config": "^3.0.1",
73
+ "@intlayer/design-system": "^3.0.1",
74
+ "@intlayer/dictionaries-entry": "^3.0.1",
75
+ "@intlayer/core": "^3.0.1",
76
+ "intlayer": "^3.0.1"
81
77
  },
82
78
  "devDependencies": {
83
79
  "@babel/generator": "7.24.4",
@@ -90,31 +86,39 @@
90
86
  "@types/node": "^20.14.9",
91
87
  "@types/react": "^18.3.3",
92
88
  "@types/react-dom": "^18.3.0",
89
+ "concurrently": "^8.2.2",
90
+ "eslint": "^9.11.1",
91
+ "prettier": "3.3.3",
93
92
  "rimraf": "5.0.5",
94
93
  "ts-node": "^10.9.2",
95
- "tsup": "^8.1.0",
94
+ "tsc-alias": "^1.8.10",
95
+ "tsup": "^8.3.0",
96
96
  "typescript": "^5.5.2",
97
- "@utils/eslint-config": "^1.0.4",
98
- "@utils/ts-config": "^1.0.4"
97
+ "@utils/ts-config": "^1.0.4",
98
+ "@utils/ts-config-types": "^1.0.4",
99
+ "@utils/tsup-config": "^1.0.4",
100
+ "@utils/eslint-config": "^1.0.4"
99
101
  },
100
102
  "engines": {
101
103
  "node": ">=14.18"
102
104
  },
103
105
  "bug": {
104
- "url": "https://github.com/aypineau/intlayer/issues"
106
+ "url": "https://github.com/aymericzip/intlayer/issues"
105
107
  },
106
108
  "scripts": {
107
- "build": "tsup",
109
+ "build": "pnpm build:package & pnpm build:types",
110
+ "build:package": "tsup",
111
+ "build:types": "tsc --project ./tsconfig.types.json && tsc-alias --project ./tsconfig.types.json",
108
112
  "clean": "rimraf ./dist",
109
- "dev": "tsup --watch",
110
- "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs",
111
- "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs --fix",
112
- "prettier": "prettier --check src",
113
- "prettier:fix": "prettier --write src",
113
+ "dev": "concurrently --prefix none \"tsup --watch\" \"tsc --project ./tsconfig.types.json --watch\" \"tsc-alias --project ./tsconfig.types.json --watch\"",
114
+ "lint": "eslint . --cache",
115
+ "lint:fix": "eslint . --cache --fix",
116
+ "prettier": "prettier . --check",
117
+ "prettier:fix": "prettier . --write",
114
118
  "serve": "webpack serve --config ./webpack.config.ts",
115
119
  "start:dev": "node --experimental-specifier-resolution=node --loader ts-node/esm --watch src/index.ts",
116
120
  "transpile": "webpack --config ./webpack.config.ts",
117
- "typecheck": "tsup--project ./tsconfig.json --noEmit",
121
+ "typecheck": "tsup --project ./tsconfig.json --noEmit",
118
122
  "watch": "webpack --config ./webpack.config.ts --watch"
119
123
  }
120
124
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/ContentEditionLayout.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport type { FC, ReactNode } from 'react';\nimport { IntlayerEditorProvider } from './ContentEditorProvider';\nimport { DictionaryEditionDrawerController } from './DictionaryEditionDrawer/index';\nimport { DictionaryListDrawer } from './DictionaryListDrawer/index';\n\nexport type ContentEditionLayoutProps = {\n children?: ReactNode;\n locale: Locales;\n localeList: Locales[];\n setLocale: (locale: Locales) => void;\n editorEnabled?: boolean;\n};\n\nexport const ContentEditionLayout: FC<ContentEditionLayoutProps> = ({\n children,\n locale,\n setLocale,\n localeList,\n editorEnabled = true,\n}) => {\n return (\n <>\n <IntlayerEditorProvider editorEnabled={editorEnabled}>\n {children}\n\n {editorEnabled && (\n <>\n <DictionaryEditionDrawerController\n locale={locale}\n localeList={localeList}\n setLocale={setLocale}\n />\n <DictionaryListDrawer />\n </>\n )}\n </IntlayerEditorProvider>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BU;AAzBV,mCAAuC;AACvC,qCAAkD;AAClD,kCAAqC;AAU9B,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAClB,MAAM;AACJ,SACE,2EACE,uDAAC,uDAAuB,eACrB;AAAA;AAAA,IAEA,iBACC,4EACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MACA,4CAAC,oDAAqB;AAAA,OACxB;AAAA,KAEJ,GACF;AAEJ;","names":[]}
@@ -1,13 +0,0 @@
1
- import { Locales } from '@intlayer/config/client';
2
- import { ReactNode, FC } from 'react';
3
-
4
- type ContentEditionLayoutProps = {
5
- children?: ReactNode;
6
- locale: Locales;
7
- localeList: Locales[];
8
- setLocale: (locale: Locales) => void;
9
- editorEnabled?: boolean;
10
- };
11
- declare const ContentEditionLayout: FC<ContentEditionLayoutProps>;
12
-
13
- export { ContentEditionLayout, type ContentEditionLayoutProps };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/ContentEditorProvider.tsx"],"sourcesContent":["'use client';\n\nimport { getConfiguration } from '@intlayer/config/client';\nimport {\n type PropsWithChildren,\n createContext,\n useContext,\n type FC,\n} from 'react';\n\ntype IntlayerEditorValue = {\n editorEnabled: boolean;\n};\n\n/**\n * Context that store the current locale on the client side\n */\nexport const IntlayerEditorContext = createContext<IntlayerEditorValue>({\n editorEnabled: false,\n});\n\n/**\n * Hook that provides the current locale\n */\nexport const useIntlayerEditorContext = () => useContext(IntlayerEditorContext);\n\nexport type IntlayerEditorProviderProps = PropsWithChildren & {\n editorEnabled?: boolean;\n};\n\nconst {\n editor: { enabled },\n} = getConfiguration();\n\n/**\n * Provider that store the current locale on the client side\n */\nexport const IntlayerEditorProvider: FC<IntlayerEditorProviderProps> = ({\n children,\n editorEnabled = enabled,\n}) => (\n <IntlayerEditorContext.Provider value={{ editorEnabled }}>\n {children}\n </IntlayerEditorContext.Provider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCE;AAvCF,oBAAiC;AACjC,mBAKO;AASA,MAAM,4BAAwB,4BAAmC;AAAA,EACtE,eAAe;AACjB,CAAC;AAKM,MAAM,2BAA2B,UAAM,yBAAW,qBAAqB;AAM9E,MAAM;AAAA,EACJ,QAAQ,EAAE,QAAQ;AACpB,QAAI,gCAAiB;AAKd,MAAM,yBAA0D,CAAC;AAAA,EACtE;AAAA,EACA,gBAAgB;AAClB,MACE,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,cAAc,GACpD,UACH;","names":[]}
@@ -1,23 +0,0 @@
1
- import * as react from 'react';
2
- import { PropsWithChildren, FC } from 'react';
3
-
4
- type IntlayerEditorValue = {
5
- editorEnabled: boolean;
6
- };
7
- /**
8
- * Context that store the current locale on the client side
9
- */
10
- declare const IntlayerEditorContext: react.Context<IntlayerEditorValue>;
11
- /**
12
- * Hook that provides the current locale
13
- */
14
- declare const useIntlayerEditorContext: () => IntlayerEditorValue;
15
- type IntlayerEditorProviderProps = PropsWithChildren & {
16
- editorEnabled?: boolean;
17
- };
18
- /**
19
- * Provider that store the current locale on the client side
20
- */
21
- declare const IntlayerEditorProvider: FC<IntlayerEditorProviderProps>;
22
-
23
- export { IntlayerEditorContext, IntlayerEditorProvider, type IntlayerEditorProviderProps, useIntlayerEditorContext };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/ContentSelectorWrapper.tsx"],"sourcesContent":["'use client';\n\nimport { isSameKeyPath, type KeyPath } from '@intlayer/core';\nimport { ContentSelector } from '@intlayer/design-system';\nimport { useCallback, useContext, type FC, type ReactNode } from 'react';\nimport { IntlayerEditorContext } from './ContentEditorProvider';\nimport { useDictionaryEditionDrawer } from './DictionaryEditionDrawer/useDictionaryEditionDrawer';\n\ntype ContentSelectorWrapperProps = {\n children: ReactNode;\n dictionaryId: string;\n dictionaryPath: string;\n keyPath: KeyPath[];\n};\n\nexport const ContentSelectorWrapper: FC<ContentSelectorWrapperProps> = ({\n children,\n dictionaryId,\n dictionaryPath,\n keyPath,\n}) => {\n const { open, getEditedContentValue, focusedContent, isOpen } =\n useDictionaryEditionDrawer(dictionaryId);\n const editedValue = getEditedContentValue(dictionaryPath, keyPath);\n const { editorEnabled } = useContext(IntlayerEditorContext);\n\n const handleSelect = useCallback(\n () =>\n open({\n dictionaryId,\n dictionaryPath,\n keyPath,\n }),\n [dictionaryId, dictionaryPath, keyPath, open]\n );\n\n const isSelected =\n (isOpen &&\n (focusedContent?.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(focusedContent?.keyPath ?? [], keyPath)) ??\n false;\n\n if (!editorEnabled) {\n return children;\n }\n\n return (\n <ContentSelector\n onSelect={handleSelect}\n isSelecting={isSelected}\n popoverContent=\"Long press to edit\"\n >\n {editedValue ?? children}\n </ContentSelector>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CI;AA7CJ,kBAA4C;AAC5C,2BAAgC;AAChC,mBAAiE;AACjE,mCAAsC;AACtC,wCAA2C;AASpC,MAAM,yBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,MAAM,uBAAuB,gBAAgB,OAAO,QAC1D,8DAA2B,YAAY;AACzC,QAAM,cAAc,sBAAsB,gBAAgB,OAAO;AACjE,QAAM,EAAE,cAAc,QAAI,yBAAW,kDAAqB;AAE1D,QAAM,mBAAe;AAAA,IACnB,MACE,KAAK;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACH,CAAC,cAAc,gBAAgB,SAAS,IAAI;AAAA,EAC9C;AAEA,QAAM,cACH,WACE,gBAAgB,SAAS,UAAU,KAAK,SACzC,2BAAc,gBAAgB,WAAW,CAAC,GAAG,OAAO,MACtD;AAEF,MAAI,CAAC,eAAe;AAClB,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV,aAAa;AAAA,MACb,gBAAe;AAAA,MAEd,yBAAe;AAAA;AAAA,EAClB;AAEJ;","names":[]}
@@ -1,12 +0,0 @@
1
- import { KeyPath } from '@intlayer/core';
2
- import { FC, ReactNode } from 'react';
3
-
4
- type ContentSelectorWrapperProps = {
5
- children: ReactNode;
6
- dictionaryId: string;
7
- dictionaryPath: string;
8
- keyPath: KeyPath[];
9
- };
10
- declare const ContentSelectorWrapper: FC<ContentSelectorWrapperProps>;
11
-
12
- export { ContentSelectorWrapper };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryEditionDrawer/DictionaryEditionDrawer.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n RightDrawer,\n DictionaryEditor,\n LocaleSwitcher,\n type FileContent,\n} from '@intlayer/design-system';\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\nimport dictionaries from '@intlayer/dictionaries-entry';\nimport type { FC } from 'react';\nimport { useDictionaryListDrawer } from '../DictionaryListDrawer/index';\nimport {\n type FileContent as FileContentWithDictionaryPath,\n useDictionaryEditionDrawer,\n} from './useDictionaryEditionDrawer';\nimport { useEditionPanelStore } from './useFocusContentStore';\n\ntype DictionaryEditionDrawerContentProps = {\n focusedContent: FileContentWithDictionaryPath;\n locale: Locales;\n identifier: string;\n};\n\nexport const DictionaryEditionDrawerContent: FC<\n DictionaryEditionDrawerContentProps\n> = ({ focusedContent, locale, identifier }) => {\n const {\n setFocusedContent,\n editContentRequest,\n editedContent,\n addEditedContent,\n clearEditedDictionaryContent,\n } = useDictionaryEditionDrawer(identifier);\n\n const dictionaryId: string = focusedContent.dictionaryId;\n const dictionary: Dictionary = dictionaries[dictionaryId];\n const dictionaryPath: string = dictionary.filePath;\n const editedDictionaryContent: FileContent[] = editedContent[dictionaryPath];\n\n return (\n <DictionaryEditor\n dictionary={dictionary}\n locale={locale}\n focusedKeyPath={focusedContent.keyPath}\n editedContent={editedDictionaryContent}\n onFocusKeyPath={(keyPath) =>\n setFocusedContent({ ...focusedContent, keyPath })\n }\n onContentChange={(keyPath, newValue) =>\n addEditedContent(dictionaryPath, keyPath, newValue)\n }\n onValidEdition={editContentRequest}\n onCancelEdition={() => clearEditedDictionaryContent(dictionaryPath)}\n />\n );\n};\n\ntype DictionaryEditionDrawerProps = DictionaryEditionDrawerControllerProps & {\n dictionaryId: string;\n};\n\nexport const getDrawerIdentifier = (dictionaryId: string) =>\n `dictionary_edition_${dictionaryId}`;\n\nexport const DictionaryEditionDrawer: FC<DictionaryEditionDrawerProps> = ({\n locale,\n localeList,\n setLocale,\n dictionaryId,\n}) => {\n const id = getDrawerIdentifier(dictionaryId);\n\n const { focusedContent, close } = useDictionaryEditionDrawer(dictionaryId);\n const { open: openDictionaryListDrawer } = useDictionaryListDrawer();\n\n const handleOnBack = () => {\n close();\n openDictionaryListDrawer();\n };\n\n return (\n <RightDrawer\n title={dictionaryId}\n identifier={id}\n header={\n <LocaleSwitcher\n setLocale={setLocale}\n locale={locale}\n localeList={localeList}\n />\n }\n backButton={{\n onBack: handleOnBack,\n text: 'Dictionary list',\n }}\n >\n {focusedContent && (\n <DictionaryEditionDrawerContent\n focusedContent={focusedContent}\n locale={locale}\n identifier={id}\n />\n )}\n </RightDrawer>\n );\n};\n\ntype DictionaryEditionDrawerControllerProps = {\n locale: Locales;\n localeList: Locales[];\n setLocale: (locale: Locales) => void;\n};\n\nexport const DictionaryEditionDrawerController: FC<\n DictionaryEditionDrawerControllerProps\n> = ({ locale, localeList, setLocale }) => {\n const focusedContent = useEditionPanelStore((s) => s.focusedContent);\n const dictionaryId: string | undefined = focusedContent?.dictionaryId;\n\n if (!dictionaryId) {\n return null;\n }\n\n return (\n <DictionaryEditionDrawer\n locale={locale}\n localeList={localeList}\n setLocale={setLocale}\n dictionaryId={dictionaryId}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CI;AA3CJ,2BAKO;AAMP,gCAAyB;AAEzB,kCAAwC;AACxC,wCAGO;AACP,kCAAqC;AAQ9B,MAAM,iCAET,CAAC,EAAE,gBAAgB,QAAQ,WAAW,MAAM;AAC9C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,8DAA2B,UAAU;AAEzC,QAAM,eAAuB,eAAe;AAC5C,QAAM,aAAyB,0BAAAA,QAAa,YAAY;AACxD,QAAM,iBAAyB,WAAW;AAC1C,QAAM,0BAAyC,cAAc,cAAc;AAE3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,gBAAgB,eAAe;AAAA,MAC/B,eAAe;AAAA,MACf,gBAAgB,CAAC,YACf,kBAAkB,EAAE,GAAG,gBAAgB,QAAQ,CAAC;AAAA,MAElD,iBAAiB,CAAC,SAAS,aACzB,iBAAiB,gBAAgB,SAAS,QAAQ;AAAA,MAEpD,gBAAgB;AAAA,MAChB,iBAAiB,MAAM,6BAA6B,cAAc;AAAA;AAAA,EACpE;AAEJ;AAMO,MAAM,sBAAsB,CAAC,iBAClC,sBAAsB,YAAY;AAE7B,MAAM,0BAA4D,CAAC;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,KAAK,oBAAoB,YAAY;AAE3C,QAAM,EAAE,gBAAgB,MAAM,QAAI,8DAA2B,YAAY;AACzE,QAAM,EAAE,MAAM,yBAAyB,QAAI,qDAAwB;AAEnE,QAAM,eAAe,MAAM;AACzB,UAAM;AACN,6BAAyB;AAAA,EAC3B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,QACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MAEF,YAAY;AAAA,QACV,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,MAEC,4BACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,YAAY;AAAA;AAAA,MACd;AAAA;AAAA,EAEJ;AAEJ;AAQO,MAAM,oCAET,CAAC,EAAE,QAAQ,YAAY,UAAU,MAAM;AACzC,QAAM,qBAAiB,kDAAqB,CAAC,MAAM,EAAE,cAAc;AACnE,QAAM,eAAmC,gBAAgB;AAEzD,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":["dictionaries"]}
@@ -1,28 +0,0 @@
1
- import { Locales } from '@intlayer/config/client';
2
- import { FC } from 'react';
3
- import { FileContent } from './useDictionaryEditionDrawer.js';
4
- import './useEditedContentStore.js';
5
- import '@intlayer/core';
6
- import 'zustand/middleware';
7
- import 'zustand';
8
- import '@intlayer/design-system';
9
-
10
- type DictionaryEditionDrawerContentProps = {
11
- focusedContent: FileContent;
12
- locale: Locales;
13
- identifier: string;
14
- };
15
- declare const DictionaryEditionDrawerContent: FC<DictionaryEditionDrawerContentProps>;
16
- type DictionaryEditionDrawerProps = DictionaryEditionDrawerControllerProps & {
17
- dictionaryId: string;
18
- };
19
- declare const getDrawerIdentifier: (dictionaryId: string) => string;
20
- declare const DictionaryEditionDrawer: FC<DictionaryEditionDrawerProps>;
21
- type DictionaryEditionDrawerControllerProps = {
22
- locale: Locales;
23
- localeList: Locales[];
24
- setLocale: (locale: Locales) => void;
25
- };
26
- declare const DictionaryEditionDrawerController: FC<DictionaryEditionDrawerControllerProps>;
27
-
28
- export { DictionaryEditionDrawer, DictionaryEditionDrawerContent, DictionaryEditionDrawerController, getDrawerIdentifier };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryEditionDrawer/index.ts"],"sourcesContent":["export * from './DictionaryEditionDrawer';\nexport * from './useDictionaryEditionDrawer';\nexport * from './useEditedContentStore';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4CAAc,sCAAd;AACA,4CAAc,yCADd;AAEA,4CAAc,oCAFd;","names":[]}
@@ -1,9 +0,0 @@
1
- export { DictionaryEditionDrawer, DictionaryEditionDrawerContent, DictionaryEditionDrawerController, getDrawerIdentifier } from './DictionaryEditionDrawer.js';
2
- export { FileContent, useDictionaryEditionDrawer, useDictionaryEditionDrawerControl } from './useDictionaryEditionDrawer.js';
3
- export { EditedContent, useEditedContentStore } from './useEditedContentStore.js';
4
- import '@intlayer/config/client';
5
- import 'react';
6
- import '@intlayer/core';
7
- import 'zustand/middleware';
8
- import 'zustand';
9
- import '@intlayer/design-system';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryEditionDrawer/useDictionaryEditionDrawer.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport { useRightDrawerStore } from '@intlayer/design-system';\nimport { useEditorServer } from '../useEditorServer';\nimport { getDrawerIdentifier } from './DictionaryEditionDrawer';\nimport {\n type EditedContent,\n useEditedContentStore,\n} from './useEditedContentStore';\nimport { useEditionPanelStore } from './useFocusContentStore';\n\ntype DictionaryPath = string;\nexport type FileContent = {\n dictionaryPath: DictionaryPath;\n dictionaryId: string;\n keyPath?: KeyPath[];\n};\n\ntype DictionaryEditionDrawer = {\n focusedContent: FileContent | null;\n setFocusedContent: (content: FileContent | null) => void;\n isOpen: boolean;\n open: (content: FileContent) => void;\n close: () => void;\n editContentRequest: () => Promise<void>;\n editedContent: EditedContent;\n addEditedContent: (\n dictionaryPath: DictionaryPath,\n keyPath: KeyPath[],\n newValue: string\n ) => void;\n getEditedContentValue: (\n dictionaryPath: DictionaryPath,\n keyPath: KeyPath[]\n ) => string | undefined;\n clearEditedDictionaryContent: (dictionaryPath: DictionaryPath) => void;\n};\n\ntype OpenDictionaryEditionDrawerProps = {\n dictionaryId: string;\n dictionaryPath: string;\n keyPath?: KeyPath[];\n};\n\nexport const useDictionaryEditionDrawer = (\n dictionaryId: string\n): DictionaryEditionDrawer => {\n const id = getDrawerIdentifier(dictionaryId);\n const { isOpen, open, close } = useRightDrawerStore(id)();\n const {\n editedContent,\n getEditedContentValue,\n addEditedContent,\n clearEditedDictionaryContent,\n } = useEditedContentStore((s) => ({\n editedContent: s.editedContent,\n addEditedContent: s.addEditedContent,\n getEditedContentValue: s.getEditedContentValue,\n clearEditedDictionaryContent: s.clearEditedDictionaryContent,\n }));\n const { setFocusedContent, focusedContent } = useEditionPanelStore((s) => ({\n focusedContent: s.focusedContent,\n setFocusedContent: s.setFocusedContent,\n }));\n const { editContentRequest } = useEditorServer();\n\n const openDictionaryEditionDrawer = ({\n dictionaryId,\n dictionaryPath,\n keyPath = [],\n }: OpenDictionaryEditionDrawerProps) => {\n setFocusedContent({\n dictionaryId,\n dictionaryPath,\n keyPath,\n });\n\n open();\n };\n\n return {\n isOpen,\n focusedContent,\n setFocusedContent,\n open: openDictionaryEditionDrawer,\n close,\n getEditedContentValue,\n editContentRequest,\n editedContent,\n addEditedContent,\n clearEditedDictionaryContent,\n };\n};\n\ntype DictionaryEditionDrawerControl = {\n open: (content: FileContent) => void;\n close: (dictionaryId: string) => void;\n};\n\nexport const useDictionaryEditionDrawerControl =\n (): DictionaryEditionDrawerControl => {\n const setFocusedContent = useEditionPanelStore((s) => s.setFocusedContent);\n\n const open = ({\n dictionaryId,\n dictionaryPath,\n keyPath = [],\n }: OpenDictionaryEditionDrawerProps) => {\n setFocusedContent({\n dictionaryId,\n dictionaryPath,\n keyPath,\n });\n\n const id = getDrawerIdentifier(dictionaryId);\n\n useRightDrawerStore(id).getState().open();\n };\n\n const close = (dictionaryId: string) => {\n const id = getDrawerIdentifier(dictionaryId);\n\n useRightDrawerStore(id).getState().close();\n };\n\n return {\n open,\n close,\n };\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAoC;AACpC,6BAAgC;AAChC,qCAAoC;AACpC,mCAGO;AACP,kCAAqC;AAmC9B,MAAM,6BAA6B,CACxC,iBAC4B;AAC5B,QAAM,SAAK,oDAAoB,YAAY;AAC3C,QAAM,EAAE,QAAQ,MAAM,MAAM,QAAI,0CAAoB,EAAE,EAAE;AACxD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,oDAAsB,CAAC,OAAO;AAAA,IAChC,eAAe,EAAE;AAAA,IACjB,kBAAkB,EAAE;AAAA,IACpB,uBAAuB,EAAE;AAAA,IACzB,8BAA8B,EAAE;AAAA,EAClC,EAAE;AACF,QAAM,EAAE,mBAAmB,eAAe,QAAI,kDAAqB,CAAC,OAAO;AAAA,IACzE,gBAAgB,EAAE;AAAA,IAClB,mBAAmB,EAAE;AAAA,EACvB,EAAE;AACF,QAAM,EAAE,mBAAmB,QAAI,wCAAgB;AAE/C,QAAM,8BAA8B,CAAC;AAAA,IACnC,cAAAA;AAAA,IACA;AAAA,IACA,UAAU,CAAC;AAAA,EACb,MAAwC;AACtC,sBAAkB;AAAA,MAChB,cAAAA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,SAAK;AAAA,EACP;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,MAAM,oCACX,MAAsC;AACpC,QAAM,wBAAoB,kDAAqB,CAAC,MAAM,EAAE,iBAAiB;AAEzE,QAAM,OAAO,CAAC;AAAA,IACZ;AAAA,IACA;AAAA,IACA,UAAU,CAAC;AAAA,EACb,MAAwC;AACtC,sBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,SAAK,oDAAoB,YAAY;AAE3C,kDAAoB,EAAE,EAAE,SAAS,EAAE,KAAK;AAAA,EAC1C;AAEA,QAAM,QAAQ,CAAC,iBAAyB;AACtC,UAAM,SAAK,oDAAoB,YAAY;AAE3C,kDAAoB,EAAE,EAAE,SAAS,EAAE,MAAM;AAAA,EAC3C;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":["dictionaryId"]}
@@ -1,32 +0,0 @@
1
- import { KeyPath } from '@intlayer/core';
2
- import { EditedContent } from './useEditedContentStore.js';
3
- import 'zustand/middleware';
4
- import 'zustand';
5
- import '@intlayer/design-system';
6
-
7
- type DictionaryPath = string;
8
- type FileContent = {
9
- dictionaryPath: DictionaryPath;
10
- dictionaryId: string;
11
- keyPath?: KeyPath[];
12
- };
13
- type DictionaryEditionDrawer = {
14
- focusedContent: FileContent | null;
15
- setFocusedContent: (content: FileContent | null) => void;
16
- isOpen: boolean;
17
- open: (content: FileContent) => void;
18
- close: () => void;
19
- editContentRequest: () => Promise<void>;
20
- editedContent: EditedContent;
21
- addEditedContent: (dictionaryPath: DictionaryPath, keyPath: KeyPath[], newValue: string) => void;
22
- getEditedContentValue: (dictionaryPath: DictionaryPath, keyPath: KeyPath[]) => string | undefined;
23
- clearEditedDictionaryContent: (dictionaryPath: DictionaryPath) => void;
24
- };
25
- declare const useDictionaryEditionDrawer: (dictionaryId: string) => DictionaryEditionDrawer;
26
- type DictionaryEditionDrawerControl = {
27
- open: (content: FileContent) => void;
28
- close: (dictionaryId: string) => void;
29
- };
30
- declare const useDictionaryEditionDrawerControl: () => DictionaryEditionDrawerControl;
31
-
32
- export { type FileContent, useDictionaryEditionDrawer, useDictionaryEditionDrawerControl };
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useEditedContentStore_exports = {};
20
- __export(useEditedContentStore_exports, {
21
- useEditedContentStore: () => useEditedContentStore
22
- });
23
- module.exports = __toCommonJS(useEditedContentStore_exports);
24
- var import_core = require("@intlayer/core");
25
- var import_zustand = require("zustand");
26
- var import_middleware = require("zustand/middleware");
27
- const useEditedContentStore = (0, import_zustand.create)(
28
- (0, import_middleware.persist)(
29
- (set, get) => ({
30
- editedContent: {},
31
- addEditedContent: (dictionaryPath, keyPath, newValue) => {
32
- set((state) => {
33
- const editedContent = state.editedContent[dictionaryPath] ?? [];
34
- return {
35
- editedContent: {
36
- ...state.editedContent,
37
- [dictionaryPath]: [
38
- ...editedContent.filter(
39
- (content) => !(0, import_core.isSameKeyPath)(content.keyPath, keyPath)
40
- ),
41
- {
42
- keyPath,
43
- newValue
44
- }
45
- ]
46
- }
47
- };
48
- });
49
- },
50
- removeEditedContent: (dictionaryPath, keyPath) => {
51
- set((state) => {
52
- const editedContent = state.editedContent[dictionaryPath] ?? [];
53
- return {
54
- editedContent: {
55
- ...state.editedContent,
56
- [dictionaryPath]: editedContent.filter(
57
- (content) => content.keyPath !== keyPath
58
- )
59
- }
60
- };
61
- });
62
- },
63
- clearEditedDictionaryContent: (dictionaryPath) => {
64
- set((state) => {
65
- const filteredEditedContent = Object.entries(
66
- state.editedContent
67
- ).reduce((acc, [path, content]) => {
68
- if (path === dictionaryPath) {
69
- return acc;
70
- }
71
- return {
72
- ...acc,
73
- [path]: content
74
- };
75
- }, {});
76
- return {
77
- editedContent: filteredEditedContent
78
- };
79
- });
80
- },
81
- clearEditedContent: () => {
82
- set({ editedContent: {} });
83
- },
84
- getEditedContentValue: (dictionaryPath, keyPath) => get().editedContent[dictionaryPath]?.find(
85
- (content) => (0, import_core.isSameKeyPath)(content.keyPath, keyPath)
86
- )?.newValue
87
- }),
88
- {
89
- name: "edited-content-store",
90
- storage: (0, import_middleware.createJSONStorage)(() => sessionStorage)
91
- }
92
- )
93
- );
94
- // Annotate the CommonJS export names for ESM import in node:
95
- 0 && (module.exports = {
96
- useEditedContentStore
97
- });
98
- //# sourceMappingURL=useEditedContentStore.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryEditionDrawer/useEditedContentStore.ts"],"sourcesContent":["import { type KeyPath, isSameKeyPath } from '@intlayer/core';\nimport type { FileContent } from '@intlayer/design-system';\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\n\ntype DictionaryPath = string;\n\nexport type EditedContent = Record<DictionaryPath, FileContent[]>;\n\ntype EditedContentStore = {\n editedContent: EditedContent;\n addEditedContent: (\n dictionaryPath: DictionaryPath,\n keyPath: KeyPath[],\n newValue: string\n ) => void;\n removeEditedContent: (\n dictionaryPath: DictionaryPath,\n keyPath: KeyPath[]\n ) => void;\n clearEditedDictionaryContent: (dictionaryPath: DictionaryPath) => void;\n clearEditedContent: () => void;\n getEditedContentValue: (\n dictionaryPath: DictionaryPath,\n keyPath: KeyPath[]\n ) => string | undefined;\n};\n\nexport const useEditedContentStore = create(\n persist<EditedContentStore>(\n (set, get) => ({\n editedContent: {},\n addEditedContent: (dictionaryPath, keyPath, newValue) => {\n set((state) => {\n const editedContent = state.editedContent[dictionaryPath] ?? [];\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryPath]: [\n ...editedContent.filter(\n (content) => !isSameKeyPath(content.keyPath, keyPath)\n ),\n {\n keyPath,\n newValue,\n },\n ],\n },\n };\n });\n },\n\n removeEditedContent: (dictionaryPath, keyPath) => {\n set((state) => {\n const editedContent = state.editedContent[dictionaryPath] ?? [];\n return {\n editedContent: {\n ...state.editedContent,\n [dictionaryPath]: editedContent.filter(\n (content) => content.keyPath !== keyPath\n ),\n },\n };\n });\n },\n\n clearEditedDictionaryContent: (dictionaryPath) => {\n set((state) => {\n const filteredEditedContent = Object.entries(\n state.editedContent\n ).reduce((acc, [path, content]) => {\n if (path === dictionaryPath) {\n return acc;\n }\n\n return {\n ...acc,\n [path]: content,\n };\n }, {});\n\n return {\n editedContent: filteredEditedContent,\n };\n });\n },\n\n clearEditedContent: () => {\n set({ editedContent: {} });\n },\n\n getEditedContentValue: (dictionaryPath, keyPath): string | undefined =>\n get().editedContent[dictionaryPath]?.find((content) =>\n isSameKeyPath(content.keyPath, keyPath)\n )?.newValue,\n }),\n {\n name: 'edited-content-store',\n storage: createJSONStorage(() => sessionStorage),\n }\n )\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4C;AAE5C,qBAAuB;AACvB,wBAA2C;AAyBpC,MAAM,4BAAwB;AAAA,MACnC;AAAA,IACE,CAAC,KAAK,SAAS;AAAA,MACb,eAAe,CAAC;AAAA,MAChB,kBAAkB,CAAC,gBAAgB,SAAS,aAAa;AACvD,YAAI,CAAC,UAAU;AACb,gBAAM,gBAAgB,MAAM,cAAc,cAAc,KAAK,CAAC;AAC9D,iBAAO;AAAA,YACL,eAAe;AAAA,cACb,GAAG,MAAM;AAAA,cACT,CAAC,cAAc,GAAG;AAAA,gBAChB,GAAG,cAAc;AAAA,kBACf,CAAC,YAAY,KAAC,2BAAc,QAAQ,SAAS,OAAO;AAAA,gBACtD;AAAA,gBACA;AAAA,kBACE;AAAA,kBACA;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MAEA,qBAAqB,CAAC,gBAAgB,YAAY;AAChD,YAAI,CAAC,UAAU;AACb,gBAAM,gBAAgB,MAAM,cAAc,cAAc,KAAK,CAAC;AAC9D,iBAAO;AAAA,YACL,eAAe;AAAA,cACb,GAAG,MAAM;AAAA,cACT,CAAC,cAAc,GAAG,cAAc;AAAA,gBAC9B,CAAC,YAAY,QAAQ,YAAY;AAAA,cACnC;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MAEA,8BAA8B,CAAC,mBAAmB;AAChD,YAAI,CAAC,UAAU;AACb,gBAAM,wBAAwB,OAAO;AAAA,YACnC,MAAM;AAAA,UACR,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,OAAO,MAAM;AACjC,gBAAI,SAAS,gBAAgB;AAC3B,qBAAO;AAAA,YACT;AAEA,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,CAAC,IAAI,GAAG;AAAA,YACV;AAAA,UACF,GAAG,CAAC,CAAC;AAEL,iBAAO;AAAA,YACL,eAAe;AAAA,UACjB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MAEA,oBAAoB,MAAM;AACxB,YAAI,EAAE,eAAe,CAAC,EAAE,CAAC;AAAA,MAC3B;AAAA,MAEA,uBAAuB,CAAC,gBAAgB,YACtC,IAAI,EAAE,cAAc,cAAc,GAAG;AAAA,QAAK,CAAC,gBACzC,2BAAc,QAAQ,SAAS,OAAO;AAAA,MACxC,GAAG;AAAA,IACP;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aAAS,qCAAkB,MAAM,cAAc;AAAA,IACjD;AAAA,EACF;AACF;","names":[]}
@@ -1,28 +0,0 @@
1
- import * as zustand_middleware from 'zustand/middleware';
2
- import * as zustand from 'zustand';
3
- import { KeyPath } from '@intlayer/core';
4
- import { FileContent } from '@intlayer/design-system';
5
-
6
- type DictionaryPath = string;
7
- type EditedContent = Record<DictionaryPath, FileContent[]>;
8
- type EditedContentStore = {
9
- editedContent: EditedContent;
10
- addEditedContent: (dictionaryPath: DictionaryPath, keyPath: KeyPath[], newValue: string) => void;
11
- removeEditedContent: (dictionaryPath: DictionaryPath, keyPath: KeyPath[]) => void;
12
- clearEditedDictionaryContent: (dictionaryPath: DictionaryPath) => void;
13
- clearEditedContent: () => void;
14
- getEditedContentValue: (dictionaryPath: DictionaryPath, keyPath: KeyPath[]) => string | undefined;
15
- };
16
- declare const useEditedContentStore: zustand.UseBoundStore<Omit<zustand.StoreApi<EditedContentStore>, "persist"> & {
17
- persist: {
18
- setOptions: (options: Partial<zustand_middleware.PersistOptions<EditedContentStore, EditedContentStore>>) => void;
19
- clearStorage: () => void;
20
- rehydrate: () => Promise<void> | void;
21
- hasHydrated: () => boolean;
22
- onHydrate: (fn: (state: EditedContentStore) => void) => () => void;
23
- onFinishHydration: (fn: (state: EditedContentStore) => void) => () => void;
24
- getOptions: () => Partial<zustand_middleware.PersistOptions<EditedContentStore, EditedContentStore>>;
25
- };
26
- }>;
27
-
28
- export { type EditedContent, useEditedContentStore };
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useFocusContentStore_exports = {};
20
- __export(useFocusContentStore_exports, {
21
- useEditionPanelStore: () => useEditionPanelStore
22
- });
23
- module.exports = __toCommonJS(useFocusContentStore_exports);
24
- var import_zustand = require("zustand");
25
- const useEditionPanelStore = (0, import_zustand.create)((set) => ({
26
- focusedContent: null,
27
- setFocusedContent: (content) => set({ focusedContent: content })
28
- }));
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- useEditionPanelStore
32
- });
33
- //# sourceMappingURL=useFocusContentStore.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryEditionDrawer/useFocusContentStore.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/core';\nimport { create } from 'zustand';\n\ntype DictionaryPath = string;\ntype FileContent = {\n dictionaryPath: DictionaryPath;\n dictionaryId: string;\n keyPath?: KeyPath[];\n};\n\ntype EditionPanelStore = {\n focusedContent: FileContent | null;\n setFocusedContent: (content: FileContent | null) => void;\n};\n\nexport const useEditionPanelStore = create<EditionPanelStore>((set) => ({\n focusedContent: null,\n setFocusedContent: (content) => set({ focusedContent: content }),\n}));\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAchB,MAAM,2BAAuB,uBAA0B,CAAC,SAAS;AAAA,EACtE,gBAAgB;AAAA,EAChB,mBAAmB,CAAC,YAAY,IAAI,EAAE,gBAAgB,QAAQ,CAAC;AACjE,EAAE;","names":[]}
@@ -1,16 +0,0 @@
1
- import * as zustand from 'zustand';
2
- import { KeyPath } from '@intlayer/core';
3
-
4
- type DictionaryPath = string;
5
- type FileContent = {
6
- dictionaryPath: DictionaryPath;
7
- dictionaryId: string;
8
- keyPath?: KeyPath[];
9
- };
10
- type EditionPanelStore = {
11
- focusedContent: FileContent | null;
12
- setFocusedContent: (content: FileContent | null) => void;
13
- };
14
- declare const useEditionPanelStore: zustand.UseBoundStore<zustand.StoreApi<EditionPanelStore>>;
15
-
16
- export { useEditionPanelStore };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryListDrawer/DictionaryListDrawer.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport { RightDrawer, RedirectionButton } from '@intlayer/design-system';\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\nimport dictionaries from '@intlayer/dictionaries-entry';\nimport type { FC } from 'react';\nimport {\n useDictionaryEditionDrawerControl,\n useEditedContentStore,\n} from '../DictionaryEditionDrawer/index';\nimport {\n dictionaryListDrawerIdentifier,\n useDictionaryListDrawer,\n} from './useDictionaryListDrawer';\n\nexport const DictionaryListDrawer: FC = () => {\n const dictionaryKeyList = Object.keys(dictionaries) as Locales[];\n const { open: openDictionaryEditionDrawer } =\n useDictionaryEditionDrawerControl();\n const { close } = useDictionaryListDrawer();\n const editedContent = useEditedContentStore((s) => s.editedContent);\n\n const handleClickDictionary = (dictionaryId: string) => {\n const { filePath } = dictionaries[dictionaryId];\n\n close();\n openDictionaryEditionDrawer({ dictionaryId, dictionaryPath: filePath });\n };\n\n const isDictionaryEdited = (dictionaryId: string) => {\n const dictionaryPath = dictionaries[dictionaryId].filePath;\n\n return Object.keys(editedContent).includes(dictionaryPath);\n };\n\n return (\n <RightDrawer\n title=\"Dictionary list\"\n identifier={dictionaryListDrawerIdentifier}\n >\n {dictionaryKeyList.map((dictionaryId) => (\n <RedirectionButton\n key={dictionaryId}\n label={`Open dictionary editor ${dictionaryId}`}\n onClick={() => handleClickDictionary(dictionaryId)}\n >\n {isDictionaryEdited(dictionaryId)\n ? `✎ ${dictionaryId}`\n : dictionaryId}\n </RedirectionButton>\n ))}\n </RightDrawer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CQ;AA3CR,2BAA+C;AAM/C,gCAAyB;AAEzB,qCAGO;AACP,qCAGO;AAEA,MAAM,uBAA2B,MAAM;AAC5C,QAAM,oBAAoB,OAAO,KAAK,0BAAAA,OAAY;AAClD,QAAM,EAAE,MAAM,4BAA4B,QACxC,kEAAkC;AACpC,QAAM,EAAE,MAAM,QAAI,wDAAwB;AAC1C,QAAM,oBAAgB,sDAAsB,CAAC,MAAM,EAAE,aAAa;AAElE,QAAM,wBAAwB,CAAC,iBAAyB;AACtD,UAAM,EAAE,SAAS,IAAI,0BAAAA,QAAa,YAAY;AAE9C,UAAM;AACN,gCAA4B,EAAE,cAAc,gBAAgB,SAAS,CAAC;AAAA,EACxE;AAEA,QAAM,qBAAqB,CAAC,iBAAyB;AACnD,UAAM,iBAAiB,0BAAAA,QAAa,YAAY,EAAE;AAElD,WAAO,OAAO,KAAK,aAAa,EAAE,SAAS,cAAc;AAAA,EAC3D;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,YAAY;AAAA,MAEX,4BAAkB,IAAI,CAAC,iBACtB;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,0BAA0B,YAAY;AAAA,UAC7C,SAAS,MAAM,sBAAsB,YAAY;AAAA,UAEhD,6BAAmB,YAAY,IAC5B,UAAK,YAAY,KACjB;AAAA;AAAA,QANC;AAAA,MAOP,CACD;AAAA;AAAA,EACH;AAEJ;","names":["dictionaries"]}
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- declare const DictionaryListDrawer: FC;
4
-
5
- export { DictionaryListDrawer };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryListDrawer/index.ts"],"sourcesContent":["export * from './DictionaryListDrawer';\nexport * from './useDictionaryListDrawer';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yCAAc,mCAAd;AACA,yCAAc,sCADd;","names":[]}
@@ -1,3 +0,0 @@
1
- export { DictionaryListDrawer } from './DictionaryListDrawer.js';
2
- export { dictionaryListDrawerIdentifier, useDictionaryListDrawer } from './useDictionaryListDrawer.js';
3
- import 'react';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/client/DictionaryListDrawer/useDictionaryListDrawer.ts"],"sourcesContent":["import { useRightDrawerStore } from '@intlayer/design-system';\n\nexport const dictionaryListDrawerIdentifier = 'dictionaryList';\n\nexport const useDictionaryListDrawer = () =>\n useRightDrawerStore(dictionaryListDrawerIdentifier)();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAoC;AAE7B,MAAM,iCAAiC;AAEvC,MAAM,0BAA0B,UACrC,0CAAoB,8BAA8B,EAAE;","names":[]}
@@ -1,8 +0,0 @@
1
- declare const dictionaryListDrawerIdentifier = "dictionaryList";
2
- declare const useDictionaryListDrawer: () => {
3
- isOpen: boolean;
4
- open: () => void;
5
- close: () => void;
6
- };
7
-
8
- export { dictionaryListDrawerIdentifier, useDictionaryListDrawer };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["export * from './DictionaryEditionDrawer/index';\nexport * from './DictionaryListDrawer/index';\nexport * from './ContentEditionLayout';\nexport * from './useEditorServer';\nexport * from './renderContentEditor';\nexport * from './ContentEditorProvider';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,4CAAd;AACA,2BAAc,yCADd;AAEA,2BAAc,mCAFd;AAGA,2BAAc,8BAHd;AAIA,2BAAc,kCAJd;AAKA,2BAAc,oCALd;","names":[]}
@@ -1,15 +0,0 @@
1
- export { DictionaryEditionDrawer, DictionaryEditionDrawerContent, DictionaryEditionDrawerController, getDrawerIdentifier } from './DictionaryEditionDrawer/DictionaryEditionDrawer.js';
2
- export { FileContent, useDictionaryEditionDrawer, useDictionaryEditionDrawerControl } from './DictionaryEditionDrawer/useDictionaryEditionDrawer.js';
3
- export { EditedContent, useEditedContentStore } from './DictionaryEditionDrawer/useEditedContentStore.js';
4
- export { DictionaryListDrawer } from './DictionaryListDrawer/DictionaryListDrawer.js';
5
- export { dictionaryListDrawerIdentifier, useDictionaryListDrawer } from './DictionaryListDrawer/useDictionaryListDrawer.js';
6
- export { ContentEditionLayout, ContentEditionLayoutProps } from './ContentEditionLayout.js';
7
- export { useEditorServer } from './useEditorServer.js';
8
- export { IntlayerEditorElementProps, RenderIntlayerEditorResult, renderIntlayerEditor } from './renderContentEditor.js';
9
- export { IntlayerEditorContext, IntlayerEditorProvider, IntlayerEditorProviderProps, useIntlayerEditorContext } from './ContentEditorProvider.js';
10
- import '@intlayer/config/client';
11
- import 'react';
12
- import '@intlayer/core';
13
- import 'zustand/middleware';
14
- import 'zustand';
15
- import '@intlayer/design-system';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/client/renderContentEditor.tsx"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/client';\nimport type { KeyPath } from '@intlayer/core';\nimport type { ReactNode } from 'react';\nimport { ContentSelectorWrapper } from './ContentSelectorWrapper';\n\nconst {\n editor: { enabled },\n} = getConfiguration();\n\nexport type IntlayerEditorElementProps = {\n content: string;\n dictionaryId: string;\n dictionaryPath: string;\n keyPath: KeyPath[];\n};\n\nexport type RenderIntlayerEditorResult = ReactNode & { value: string };\n\nconst IntlayerEditorElement = ({\n content,\n ...props\n}: IntlayerEditorElementProps) => {\n if (enabled) {\n return (\n <ContentSelectorWrapper {...props}>{content}</ContentSelectorWrapper>\n );\n }\n return content;\n};\n\nIntlayerEditorElement.content = '';\n\nexport const renderIntlayerEditor = (\n data: IntlayerEditorElementProps\n): RenderIntlayerEditorResult => {\n const Result = <IntlayerEditorElement {...data} />;\n\n return { ...Result, value: data.content };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBM;AAxBN,oBAAiC;AAGjC,oCAAuC;AAEvC,MAAM;AAAA,EACJ,QAAQ,EAAE,QAAQ;AACpB,QAAI,gCAAiB;AAWrB,MAAM,wBAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MAAkC;AAChC,MAAI,SAAS;AACX,WACE,4CAAC,wDAAwB,GAAG,OAAQ,mBAAQ;AAAA,EAEhD;AACA,SAAO;AACT;AAEA,sBAAsB,UAAU;AAEzB,MAAM,uBAAuB,CAClC,SAC+B;AAC/B,QAAM,SAAS,4CAAC,yBAAuB,GAAG,MAAM;AAEhD,SAAO,EAAE,GAAG,QAAQ,OAAO,KAAK,QAAQ;AAC1C;","names":[]}
@@ -1,15 +0,0 @@
1
- import { KeyPath } from '@intlayer/core';
2
- import { ReactNode } from 'react';
3
-
4
- type IntlayerEditorElementProps = {
5
- content: string;
6
- dictionaryId: string;
7
- dictionaryPath: string;
8
- keyPath: KeyPath[];
9
- };
10
- type RenderIntlayerEditorResult = ReactNode & {
11
- value: string;
12
- };
13
- declare const renderIntlayerEditor: (data: IntlayerEditorElementProps) => RenderIntlayerEditorResult;
14
-
15
- export { type IntlayerEditorElementProps, type RenderIntlayerEditorResult, renderIntlayerEditor };