@depict-ai/react-ui 1.5.2 → 1.5.4

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.
@@ -0,0 +1 @@
1
+ module.exports = require("@depict-ai/ui/locales/ES10");
@@ -0,0 +1,2 @@
1
+ export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/ES10";
2
+ export { cz, de, en, da, fi, pl, fr, sv, pt, no, nl, es, it } from "@depict-ai/ui/locales/ES10";
@@ -0,0 +1 @@
1
+ export * from "@depict-ai/ui/locales/ES10";
@@ -0,0 +1 @@
1
+ module.exports = require("@depict-ai/ui/locales/ES10");
@@ -1,2 +1,2 @@
1
- export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales";
2
- export { cz, de, en, da, fi, pl, fr, sv, pt, no, nl, es, it } from "@depict-ai/ui/locales";
1
+ export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/ES10";
2
+ export { cz, de, en, da, fi, pl, fr, sv, pt, no, nl, es, it } from "@depict-ai/ui/locales/ES10";
package/locales/index.js CHANGED
@@ -1 +1 @@
1
- export * from "@depict-ai/ui/locales";
1
+ export * from "@depict-ai/ui/locales/ES10";
@@ -0,0 +1 @@
1
+ module.exports = require("@depict-ai/ui/locales/latest");
@@ -0,0 +1,2 @@
1
+ export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/latest";
2
+ export { cz, de, en, da, fi, pl, fr, sv, pt, no, nl, es, it } from "@depict-ai/ui/locales/latest";
@@ -0,0 +1 @@
1
+ export * from "@depict-ai/ui/locales/latest";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * To prevent that people accidentally import multiple flavours of the same type (i.e. @depict-ai/utilishared/latest and @depict-ai/utilishared/ES7) we have this module which needs to not be transformed by babel or bundled by parcel and therefore has to support ES5
3
+ */
4
+ var versions_imported = [];
5
+
6
+ function register_es_version(package_name, es_version) {
7
+ package_name = "@depict-ai/" + package_name;
8
+ var already_imported = [];
9
+ for (var i = 0; i < versions_imported.length; i++) {
10
+ already_imported.push(package_name + "/" + versions_imported[i]);
11
+ }
12
+ var has_this_version = versions_imported.indexOf(es_version) !== -1;
13
+ if (!has_this_version) {
14
+ versions_imported.push(es_version);
15
+ }
16
+ if (versions_imported.length > 1) {
17
+ throw new Error(
18
+ "You're trying to import multiple transpiled versions of " +
19
+ package_name +
20
+ "! Already imported: " +
21
+ already_imported.join(", ") +
22
+ " and you're trying to import " +
23
+ package_name +
24
+ "/" +
25
+ es_version +
26
+ " or a dependant thereof"
27
+ );
28
+ }
29
+ }
30
+
31
+ module.exports = { register_es_version };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * To prevent that people accidentally import multiple flavours of the same type (i.e. @depict-ai/utilishared/latest and @depict-ai/utilishared/ES7) we have this module which needs to not be transformed by babel or bundled by parcel and therefore has to support ES5
3
+ */
4
+ var versions_imported = [];
5
+
6
+ function register_es_version(package_name, es_version) {
7
+ package_name = "@depict-ai/" + package_name;
8
+ var already_imported = [];
9
+ for (var i = 0; i < versions_imported.length; i++) {
10
+ already_imported.push(package_name + "/" + versions_imported[i]);
11
+ }
12
+ var has_this_version = versions_imported.indexOf(es_version) !== -1;
13
+ if (!has_this_version) {
14
+ versions_imported.push(es_version);
15
+ }
16
+ if (versions_imported.length > 1) {
17
+ throw new Error(
18
+ "You're trying to import multiple transpiled versions of " +
19
+ package_name +
20
+ "! Already imported: " +
21
+ already_imported.join(", ") +
22
+ " and you're trying to import " +
23
+ package_name +
24
+ "/" +
25
+ es_version +
26
+ " or a dependant thereof"
27
+ );
28
+ }
29
+ }
30
+
31
+ export { register_es_version };
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
- "main": "dist/main.js",
7
- "module": "dist/module.js",
8
- "types": "dist/index.d.ts",
6
+ "types": "ES10/index.d.ts",
7
+ "type": "module",
9
8
  "sass": "dist/styles/index.scss",
10
9
  "license": "MIT",
11
10
  "description": "React flavour of the Depict UI library.",
@@ -13,15 +12,15 @@
13
12
  "access": "public"
14
13
  },
15
14
  "scripts": {
16
- "clear-dist": "rm -r -f ./dist",
17
- "build": "node ./build-scripts/pre_build.js && yarn build-server && parcel build --no-source-maps && node ./build-scripts/post_build.js",
18
- "build-server": "yarn clear-dist && parcel build --no-source-maps ./src-server/index.ts && cp -r ./dist/ ./dist-server && yarn clear-dist",
15
+ "build": "build-scripts/build",
19
16
  "print-included-package-files": "yarn pack --dry-run",
20
17
  "typecheck": "yarn g:tsc --build tsconfig.json",
21
18
  "publish": "yarn build && yarn npm publish"
22
19
  },
23
20
  "targets": {
24
- "main": {
21
+ "types": {},
22
+ "module_latest": {
23
+ "outputFormat": "esmodule",
25
24
  "isLibrary": true,
26
25
  "context": "node",
27
26
  "engines": {
@@ -29,7 +28,8 @@
29
28
  },
30
29
  "optimize": false
31
30
  },
32
- "module": {
31
+ "main_latest": {
32
+ "outputFormat": "commonjs",
33
33
  "isLibrary": true,
34
34
  "context": "node",
35
35
  "engines": {
@@ -37,70 +37,108 @@
37
37
  },
38
38
  "optimize": false
39
39
  },
40
+ "module_es10": {
41
+ "outputFormat": "esmodule",
42
+ "isLibrary": true,
43
+ "context": "node",
44
+ "engines": {
45
+ "browsers": "supports array-flat"
46
+ },
47
+ "optimize": false
48
+ },
49
+ "main_es10": {
50
+ "outputFormat": "commonjs",
51
+ "isLibrary": true,
52
+ "context": "node",
53
+ "engines": {
54
+ "browsers": "supports array-flat"
55
+ },
56
+ "optimize": false
57
+ },
40
58
  "css": {
41
59
  "source": "src/styles/plain-css-fallback-styling.scss",
42
- "distDir": "dist"
60
+ "distDir": "dist/styles"
43
61
  }
44
62
  },
45
63
  "exports": {
46
64
  ".": {
65
+ "types": "./ES10/index.d.ts",
66
+ "browser": {
67
+ "import": "./ES10/index.js",
68
+ "require": "./ES10/index.cjs",
69
+ "sass": "./dist/styles/index.scss"
70
+ },
71
+ "node": {
72
+ "import": "./server/ES10/index.js",
73
+ "require": "./server/ES10/index.cjs",
74
+ "sass": "./dist/styles/index.scss"
75
+ },
76
+ "sass": "./dist/styles/index.scss"
77
+ },
78
+ "./latest": {
79
+ "types": "./latest/index.d.ts",
47
80
  "browser": {
48
- "development": {
49
- "import": {
50
- "types": "./dist/index.d.ts",
51
- "default": "./dist/module.js"
52
- },
53
- "require": "./dist/main.js"
54
- },
55
- "import": {
56
- "types": "./dist/index.d.ts",
57
- "default": "./dist/module.js"
58
- },
59
- "require": "./dist/main.js",
81
+ "import": "./latest/index.js",
82
+ "require": "./latest/index.cjs",
60
83
  "sass": "./dist/styles/index.scss"
61
84
  },
62
85
  "node": {
63
- "import": {
64
- "default": "./dist-server/module.js"
65
- },
66
- "require": "./dist-server/main.js",
86
+ "import": "./server/latest/index.js",
87
+ "require": "./server/latest/index.cjs",
67
88
  "sass": "./dist/styles/index.scss"
68
89
  },
69
- "development": {
70
- "import": {
71
- "types": "./dist/index.d.ts",
72
- "default": "./dist/module.js"
73
- },
74
- "require": "./dist/main.js",
90
+ "sass": "./dist/styles/index.scss"
91
+ },
92
+ "./ES10": {
93
+ "types": "./ES10/index.d.ts",
94
+ "browser": {
95
+ "import": "./ES10/index.js",
96
+ "require": "./ES10/index.cjs",
75
97
  "sass": "./dist/styles/index.scss"
76
98
  },
77
- "import": {
78
- "sass": "./dist/styles/index.scss",
79
- "types": "./dist/index.d.ts",
80
- "default": "./dist/module.js"
99
+ "node": {
100
+ "import": "./server/ES10/index.js",
101
+ "require": "./server/ES10/index.cjs",
102
+ "sass": "./dist/styles/index.scss"
81
103
  },
82
- "require": "./dist/main.js",
83
104
  "sass": "./dist/styles/index.scss"
84
105
  },
85
106
  "./styles/*": "./dist/styles/*",
86
107
  "./locales": {
87
- "types": "./locales/index.d.ts",
88
- "import": "./locales/index.js",
89
- "require": "./locales/require.js",
90
- "default": "./locales/index.js"
108
+ "types": "./locales/ES10/index.d.ts",
109
+ "import": "./locales/ES10/index.js",
110
+ "require": "./locales/ES10/index.cjs"
111
+ },
112
+ "./locales/latest": {
113
+ "types": "./locales/latest/index.d.ts",
114
+ "import": "./locales/latest/index.js",
115
+ "require": "./locales/latest/index.cjs"
116
+ },
117
+ "./locales/ES10": {
118
+ "types": "./locales/ES10/index.d.ts",
119
+ "import": "./locales/ES10/index.js",
120
+ "require": "./locales/ES10/index.cjs"
91
121
  }
92
122
  },
93
123
  "files": [
94
124
  "/dist",
95
- "/dist-server",
125
+ "/server",
96
126
  "/locales",
97
- "README.md"
127
+ "README.md",
128
+ "/latest",
129
+ "/ES10",
130
+ "styles.scss",
131
+ "./multi_import_deduplicator.mjs",
132
+ "./multi_import_deduplicator.cjs"
98
133
  ],
99
134
  "dependencies": {
100
- "@depict-ai/dpc": "^1.0.30",
101
- "@depict-ai/plp-styling": "^1.0.29",
102
- "@depict-ai/ui": "^1.4.3",
103
- "@depict-ai/utilishared": "^1.0.28",
135
+ "@babel/plugin-transform-typescript": "^7.22.9",
136
+ "@babel/runtime": "latest",
137
+ "@babel/runtime-corejs3": "latest",
138
+ "@depict-ai/dpc": "^1.0.31",
139
+ "@depict-ai/plp-styling": "^1.0.30",
140
+ "@depict-ai/ui": "^1.4.4",
141
+ "@depict-ai/utilishared": "^1.0.29",
104
142
  "solid-js": "^1.7.3"
105
143
  },
106
144
  "peerDependencies": {
@@ -112,12 +150,9 @@
112
150
  "@babel/core": "latest",
113
151
  "@babel/preset-env": "latest",
114
152
  "@babel/preset-typescript": "latest",
115
- "@babel/runtime": "latest",
116
- "@babel/runtime-corejs3": "latest",
117
- "@depict-ai/plp-styling": "^1.0.29",
153
+ "@depict-ai/plp-styling": "^1.0.30",
118
154
  "@jest/globals": "^29.3.1",
119
155
  "@parcel/babel-preset-env": "latest",
120
- "@parcel/resolver-default": "^2.8.0",
121
156
  "@parcel/transformer-sass": "latest",
122
157
  "@types/jest": "^29.2.6",
123
158
  "@types/node": "^18.11.11",
@@ -133,5 +168,7 @@
133
168
  "react": "^18.2.0",
134
169
  "react-dom": "^18.2.0",
135
170
  "ts-jest": "^29.0.5"
136
- }
171
+ },
172
+ "main": "ES10/index.js",
173
+ "module": "ES10/index.cjs"
137
174
  }
@@ -0,0 +1,135 @@
1
+ var $aNCHr$react = require("react");
2
+ var $aNCHr$reactjsxruntime = require("react/jsx-runtime");
3
+ var $aNCHr$depictaiui = require("@depict-ai/ui/ES10");
4
+ var $aNCHr$solidjsweb = require("solid-js/web");
5
+ require("../../multi_import_deduplicator.cjs").register_es_version("react-ui", "ES10");
6
+ function $parcel$export(e, n, v, s) {
7
+ Object.defineProperty(e, n, {
8
+ get: v,
9
+ set: s,
10
+ enumerable: true,
11
+ configurable: true
12
+ });
13
+ }
14
+ $parcel$export(module.exports, "DepictProvider", () => $202459d454907b31$export$9fac37a9c21c2f3b);
15
+ $parcel$export(module.exports, "SearchPage", () => $202459d454907b31$export$a54ec244c8863715);
16
+ $parcel$export(module.exports, "CategoryPage", () => $202459d454907b31$export$f7d2f673fc2f091d);
17
+ $parcel$export(module.exports, "BreadCrumbs", () => $202459d454907b31$export$5646050d516e06bc);
18
+ $parcel$export(module.exports, "QuickLinks", () => $202459d454907b31$export$466cdc317043f6cb);
19
+ $parcel$export(module.exports, "ComponentAligner", () => $202459d454907b31$export$80e99ee6b29cadd2);
20
+ $parcel$export(module.exports, "ImagePlaceholder", () => $202459d454907b31$export$3f37af283f8fb843);
21
+ $parcel$export(module.exports, "TextPlaceholder", () => $202459d454907b31$export$89c6019e4baa40b1);
22
+ $parcel$export(module.exports, "useSearchField", () => $202459d454907b31$export$9bb30bbe003b82e0);
23
+ $parcel$export(module.exports, "openModal", () => $202459d454907b31$export$a7f6cffb6b8ba11c);
24
+ $parcel$export(module.exports, "useSearchModal", () => $202459d454907b31$export$912994940e660d32);
25
+ $parcel$export(module.exports, "usePerformanceClient", () => $202459d454907b31$export$38b98fae14bd1f64);
26
+ $parcel$export(module.exports, "useFetchRecommendations", () => $202459d454907b31$export$6501da23a2770fc);
27
+ $parcel$export(module.exports, "version", () => $efbdd2dab4314170$export$83d89fbfd8236492);
28
+ function $f144be06c518d0ac$export$4b564d7f5a1b1d43(_ref) {
29
+ let {
30
+ solid_component: solid_component,
31
+ props: props,
32
+ wrapper_type = "div",
33
+ wrapper_style = {}
34
+ } = _ref;
35
+ const wrapper_element_ref = (0, $aNCHr$react.useRef)();
36
+ // The worst thing that can happen by multiple generateHydrationScript's is that events dispatched before the hydration are duplicated in solid's shared context which leads to them being deduplicated again here https://github.com/ryansolid/dom-expressions/blob/21fdba5bcab25986a2b93003aaace100b2231cdc/packages/dom-expressions/src/client.js#L280
37
+ const rendered_html = (0, $aNCHr$solidjsweb.renderToString)(() => solid_component(props, () => {})) + (0, $aNCHr$solidjsweb.generateHydrationScript)();
38
+ return (0, $aNCHr$react.createElement)((0, $aNCHr$react.Fragment), null, (0, $aNCHr$react.createElement)(wrapper_type, {
39
+ ref: wrapper_element_ref,
40
+ style: wrapper_style,
41
+ dangerouslySetInnerHTML: {
42
+ __html: rendered_html
43
+ }
44
+ }));
45
+ }
46
+ const $efbdd2dab4314170$export$83d89fbfd8236492 = "1.5.4";
47
+ function $202459d454907b31$export$9fac37a9c21c2f3b(props) {
48
+ return props.children;
49
+ }
50
+ function $202459d454907b31$export$a54ec244c8863715() {
51
+ return (0, $aNCHr$reactjsxruntime.jsx)("div", {
52
+ children: []
53
+ });
54
+ }
55
+ function $202459d454907b31$export$f7d2f673fc2f091d() {
56
+ return (0, $aNCHr$reactjsxruntime.jsx)("div", {
57
+ children: []
58
+ });
59
+ }
60
+ function $202459d454907b31$export$5646050d516e06bc() {
61
+ return (0, $aNCHr$reactjsxruntime.jsx)("div", {
62
+ children: []
63
+ });
64
+ }
65
+ function $202459d454907b31$export$466cdc317043f6cb() {
66
+ return (0, $aNCHr$reactjsxruntime.jsx)("div", {
67
+ children: []
68
+ });
69
+ }
70
+ function $202459d454907b31$export$80e99ee6b29cadd2() {
71
+ return (0, $aNCHr$react.createElement)("div", {
72
+ className: "depict aligner",
73
+ style: {
74
+ height: "100%"
75
+ }
76
+ });
77
+ }
78
+ function $202459d454907b31$export$3f37af283f8fb843(raw_react_props) {
79
+ const react_props = {
80
+ class: raw_react_props.className,
81
+ ...raw_react_props
82
+ };
83
+ return (0, $f144be06c518d0ac$export$4b564d7f5a1b1d43)({
84
+ solid_component: props_store => (0, $aNCHr$depictaiui.ImagePlaceholder)(props_store),
85
+ props: react_props,
86
+ wrapper_type: "span"
87
+ });
88
+ }
89
+ function $202459d454907b31$export$89c6019e4baa40b1(raw_react_props) {
90
+ const react_props = {
91
+ ...raw_react_props,
92
+ class: raw_react_props.className
93
+ };
94
+ return (0, $f144be06c518d0ac$export$4b564d7f5a1b1d43)({
95
+ solid_component: props_store => (0, $aNCHr$depictaiui.TextPlaceholder)(props_store),
96
+ props: react_props,
97
+ wrapper_type: "span",
98
+ wrapper_style: {
99
+ "height": "100%"
100
+ }
101
+ });
102
+ }
103
+ function $202459d454907b31$export$9bb30bbe003b82e0() {
104
+ return {
105
+ SearchField: () => (0, $aNCHr$reactjsxruntime.jsx)("div", {
106
+ children: []
107
+ })
108
+ };
109
+ }
110
+ function $202459d454907b31$export$a7f6cffb6b8ba11c() {}
111
+ function $202459d454907b31$export$912994940e660d32() {
112
+ return {
113
+ open: () => {}
114
+ };
115
+ }
116
+ function $202459d454907b31$export$38b98fae14bd1f64() {
117
+ const mock = {
118
+ get: function (target, property) {
119
+ if (typeof target[property] === "undefined") return () => {
120
+ throw new Error("Depict Performance Client is currently not available on the server. Please wrap your call in a useEffect hook or user event handler.");
121
+ };
122
+ return target[property];
123
+ }
124
+ };
125
+ return {
126
+ dpc: new Proxy({}, mock)
127
+ };
128
+ }
129
+ function $202459d454907b31$export$6501da23a2770fc() {
130
+ return {
131
+ fetchRecommendations: () => {
132
+ throw new Error("fetchRecommendations is currently not available on the server due to personalisation/user_id related issues. Please only call it on the client.");
133
+ }
134
+ };
135
+ }