@supersoniks/concorde 3.1.14 → 3.1.15

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 (74) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +109 -113
  3. package/concorde-core.es.js +736 -726
  4. package/dist/concorde-core.bundle.js +109 -113
  5. package/dist/concorde-core.es.js +736 -726
  6. package/docs/assets/index--bDsd7qW.css +1 -0
  7. package/docs/assets/index-Ce3mr_lI.js +4040 -0
  8. package/docs/css/docs.css +0 -0
  9. package/docs/img/concorde-logo.svg +1 -0
  10. package/docs/img/concorde.png +0 -0
  11. package/docs/img/concorde_def.png +0 -0
  12. package/docs/index.html +132 -0
  13. package/docs/src/core/components/functional/date/date.md +290 -0
  14. package/docs/src/core/components/functional/fetch/fetch.md +117 -0
  15. package/docs/src/core/components/functional/if/if.md +16 -0
  16. package/docs/src/core/components/functional/list/list.md +194 -0
  17. package/docs/src/core/components/functional/mix/mix.md +41 -0
  18. package/docs/src/core/components/functional/queue/queue.md +87 -0
  19. package/docs/src/core/components/functional/router/router.md +112 -0
  20. package/docs/src/core/components/functional/sdui/default-library.json +108 -0
  21. package/docs/src/core/components/functional/sdui/example.json +99 -0
  22. package/docs/src/core/components/functional/sdui/sdui.md +356 -0
  23. package/docs/src/core/components/functional/states/states.md +87 -0
  24. package/docs/src/core/components/functional/submit/submit.md +48 -0
  25. package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
  26. package/docs/src/core/components/functional/value/value.md +35 -0
  27. package/docs/src/core/components/ui/alert/alert.md +121 -0
  28. package/docs/src/core/components/ui/badge/badge.md +102 -0
  29. package/docs/src/core/components/ui/button/button.md +184 -0
  30. package/docs/src/core/components/ui/captcha/captcha.md +12 -0
  31. package/docs/src/core/components/ui/card/card.md +96 -0
  32. package/docs/src/core/components/ui/divider/divider.md +35 -0
  33. package/docs/src/core/components/ui/form/checkbox/checkbox.md +96 -0
  34. package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
  35. package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
  36. package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
  37. package/docs/src/core/components/ui/form/input/input.md +168 -0
  38. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
  39. package/docs/src/core/components/ui/form/radio/radio.md +86 -0
  40. package/docs/src/core/components/ui/form/select/select.md +99 -0
  41. package/docs/src/core/components/ui/form/textarea/textarea.md +66 -0
  42. package/docs/src/core/components/ui/group/group.md +75 -0
  43. package/docs/src/core/components/ui/icon/icon.md +125 -0
  44. package/docs/src/core/components/ui/icon/icons.json +1 -0
  45. package/docs/src/core/components/ui/image/image.md +107 -0
  46. package/docs/src/core/components/ui/link/link.md +43 -0
  47. package/docs/src/core/components/ui/loader/loader.md +37 -0
  48. package/docs/src/core/components/ui/menu/menu.md +288 -0
  49. package/docs/src/core/components/ui/modal/modal.md +123 -0
  50. package/docs/src/core/components/ui/pop/pop.md +79 -0
  51. package/docs/src/core/components/ui/progress/progress.md +65 -0
  52. package/docs/src/core/components/ui/table/table.md +467 -0
  53. package/docs/src/core/components/ui/tooltip/tooltip.md +37 -0
  54. package/docs/src/docs/_core-concept/overview.md +57 -0
  55. package/docs/src/docs/_core-concept/subscriber.md +76 -0
  56. package/docs/src/docs/_getting-started/concorde-outside.md +141 -0
  57. package/docs/src/docs/_getting-started/create-a-component.md +137 -0
  58. package/docs/src/docs/_getting-started/pubsub.md +150 -0
  59. package/docs/src/docs/_getting-started/start.md +37 -0
  60. package/docs/src/docs/_getting-started/theming.md +91 -0
  61. package/docs/src/docs/search/docs-search.json +3737 -0
  62. package/docs/src/tag-list.json +1 -0
  63. package/docs/src/tsconfig.json +113 -0
  64. package/docs/svg/regular/plane.svg +1 -0
  65. package/docs/svg/solid/plane.svg +1 -0
  66. package/package.json +259 -3
  67. package/postcss.config.cjs +0 -0
  68. package/scripts/pre-build.mjs +109 -0
  69. package/src/core/core.ts +1 -0
  70. package/src/core/utils/route.ts +149 -0
  71. package/src/docs/tailwind/index.ts +0 -0
  72. package/src/tsconfig-model.json +19 -0
  73. package/src/tsconfig.json +794 -109
  74. package/vite/config.js +145 -21
package/vite/config.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { resolveObjectURL } from "buffer";
1
2
  import fs from "fs";
2
3
  import path from "path";
3
4
 
@@ -12,9 +13,9 @@ function listFiles(dir) {
12
13
  if (stat && stat.isDirectory()) {
13
14
  files = files.concat(listFiles(path));
14
15
  } else {
15
- if (path.indexOf(".ts") != -1) {
16
- files.push(path);
17
- }
16
+ // if (path.indexOf(".ts") != -1) {
17
+ files.push(path);
18
+ // }
18
19
  }
19
20
  });
20
21
  return files;
@@ -38,6 +39,111 @@ componentsFiles.forEach((file) => {
38
39
  });
39
40
  }
40
41
  });
42
+ //short notation for ts file
43
+ const shortPathMapping = {};
44
+ componentsFiles.forEach((file) => {
45
+ if (!file.match(/\.ts$/)) {
46
+ return;
47
+ }
48
+ //add simplified path to tsconfig paths
49
+ const filePath = file
50
+ .replace(path.resolve(__dirname, "../src") + "/", "")
51
+ .replace(".ts", "");
52
+ //add path to tsconfig paths
53
+ const split = filePath.split("/");
54
+ if (split[1] == "components") {
55
+ const last = split.pop();
56
+ if (last == "types") {
57
+ return;
58
+ }
59
+ const type = split[2];
60
+ const subType = split[3];
61
+ if (!last) {
62
+ return;
63
+ }
64
+ if (shortPathMapping[`@concorde/${last}`]) {
65
+ console.warn(
66
+ `@concorde/${last} already exists in ${
67
+ shortPathMapping[`@concorde/${last}`]
68
+ } : ${file}`
69
+ );
70
+ }
71
+ shortPathMapping[`@concorde/${last}`] = [file];
72
+ shortPathMapping[`@concorde/${type}/${last}`] = [file];
73
+ shortPathMapping[`@supersoniks/concorde/${last}`] = [file];
74
+ shortPathMapping[`@supersoniks/concorde/${type}/${last}`] = [file];
75
+ if (subType && subType != last) {
76
+ shortPathMapping[`@concorde/${type}/${subType}/${last}`] = [file];
77
+ shortPathMapping[`@supersoniks/concorde/${type}/${subType}/${last}`] = [
78
+ file,
79
+ ];
80
+ }
81
+ } else {
82
+ split.shift();
83
+ const joined = split.join("/");
84
+ if (!joined) {
85
+ return;
86
+ }
87
+ if (shortPathMapping[`@concorde/${joined}`]) {
88
+ console.warn(
89
+ `@concorde/${joined} already exists in ${
90
+ shortPathMapping[`@concorde/${joined}`]
91
+ }`
92
+ );
93
+ }
94
+ shortPathMapping[`@concorde/${joined}`] = [file];
95
+ shortPathMapping[`@supersoniks/concorde/${joined}`] = [file];
96
+ }
97
+ });
98
+
99
+ // Fonction principale pour trouver le fichier correspondant à une URI
100
+ function resolveURI(uri) {
101
+ const parts0 = uri
102
+ .replace("@supersoniks/concorde/", "")
103
+ .replace("@concorde/", "")
104
+ .split("/");
105
+ const BASE_DIR = path.resolve(__dirname, "../src") + "/";
106
+ const results = [];
107
+ componentsFiles.forEach((file) => {
108
+ const parts = [...parts0];
109
+ const pathInProjectSplit = file
110
+ .replace(BASE_DIR, "")
111
+ .replace(".ts", "")
112
+ .split("/");
113
+
114
+ if (pathInProjectSplit[0] == "docs") {
115
+ return null;
116
+ }
117
+ if (
118
+ pathInProjectSplit[pathInProjectSplit.length - 1] !==
119
+ parts[parts.length - 1]
120
+ ) {
121
+ return null;
122
+ }
123
+ pathInProjectSplit.pop();
124
+ parts.pop();
125
+
126
+ while (parts.length > 0) {
127
+ const shifted = parts.shift();
128
+ if (!shifted) {
129
+ break;
130
+ }
131
+ while (pathInProjectSplit.length > 0) {
132
+ if (pathInProjectSplit.shift() == shifted) {
133
+ break;
134
+ }
135
+ if (pathInProjectSplit.length == 0) {
136
+ if (parts.length == 0) {
137
+ }
138
+ return;
139
+ }
140
+ }
141
+ }
142
+ results.push(file);
143
+ });
144
+
145
+ return results[results.length - 1];
146
+ }
41
147
 
42
148
  /**
43
149
  * Rollup plugin to scope components by replacing the prefix "sonic" with a custom prefix
@@ -56,33 +162,46 @@ const scopeComponents = (prefix, filesFilter) => {
56
162
 
57
163
  //Add e resolver to the plugin
58
164
  resolveId(source) {
59
- source = source.replace(
60
- /@supersoniks\/concorde\/functional\/(\w+)$/,
61
- "@supersoniks/concorde/core/components/functional/$1/$1"
62
- );
165
+ const source0 = source;
166
+ if (shortPathMapping[source]) {
167
+ return shortPathMapping[source][0];
168
+ }
169
+ /** old way */
170
+ // source = source.replace(
171
+ // /@supersoniks\/concorde\/functional\/(\w+)$/,
172
+ // "@supersoniks/concorde/core/components/functional/$1/$1"
173
+ // );
63
174
 
64
- source = source.replace(
65
- /@supersoniks\/concorde\/ui\/form\/(\w+)$/,
66
- "@supersoniks/concorde/core/components/ui/form/$1/$1"
67
- );
175
+ // source = source.replace(
176
+ // /@supersoniks\/concorde\/utils\/(\w+)$/,
177
+ // "@supersoniks/concorde/core/utils/$1"
178
+ // );
68
179
 
69
- source = source.replace(
70
- /@supersoniks\/concorde\/ui\/(\w+)$/,
71
- "@supersoniks/concorde/core/components/ui/$1/$1"
72
- );
180
+ // source = source.replace(
181
+ // /@supersoniks\/concorde\/ui\/form\/(\w+)$/,
182
+ // "@supersoniks/concorde/core/components/ui/form/$1/$1"
183
+ // );
184
+
185
+ // source = source.replace(
186
+ // /@supersoniks\/concorde\/ui\/(\w+)$/,
187
+ // "@supersoniks/concorde/core/components/ui/$1/$1"
188
+ // );
189
+
190
+ // source = source.replace(
191
+ // /@supersoniks\/concorde\/ui\/(.*?)$/,
192
+ // "@supersoniks/concorde/core/components/ui/$1"
193
+ // );
73
194
 
74
- source = source.replace(
75
- /@supersoniks\/concorde\/ui\/(.*?)$/,
76
- "@supersoniks/concorde/core/components/ui/$1"
77
- );
78
195
  let extension = path.extname(source);
79
196
  extension = extension ? "" : ".ts";
80
- // remap source beginig with @supersoniks/concorde to the local path
81
197
 
82
- return path.resolve(
198
+ // // remap source beginig with @supersoniks/concorde to the local path
199
+ const result = path.resolve(
83
200
  source.replace("@supersoniks/concorde", __dirname + "/../src") +
84
201
  extension
85
202
  );
203
+ return result;
204
+ // return resolveURI(source0);
86
205
  },
87
206
  transform(code, id) {
88
207
  if (
@@ -134,6 +253,11 @@ const config = (
134
253
  __SONIC_PREFIX__: JSON.stringify(__SONIC_PREFIX__),
135
254
  };
136
255
 
256
+ tsConfig.compilerOptions.paths = {
257
+ ...tsConfig.compilerOptions.paths,
258
+ ...shortPathMapping,
259
+ };
260
+
137
261
  if (tsConfig) {
138
262
  result.esbuild = {
139
263
  ...result.esbuild,