@code0-tech/pictor 0.0.0-mvp.43 → 0.0.0-mvp.45

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/dist/assets/components/avatar/Avatar.style.css +1 -1
  2. package/dist/assets/components/menu/Menu.style.css +1 -1
  3. package/dist/components/avatar/Avatar.d.ts +1 -0
  4. package/dist/components/avatar/Avatar.js +44 -48
  5. package/dist/components/d-application/DApplication.service.js +1 -0
  6. package/dist/components/d-flow/DFlow.edges.hook.js +3 -2
  7. package/dist/components/d-flow/DFlow.nodes.hook.js +16 -15
  8. package/dist/components/d-flow/DFlow.service.js +3 -2
  9. package/dist/components/d-flow-data-type/DFlowDataType.service.js +8 -8
  10. package/dist/components/d-flow-file/DFlowTabDefault.js +1 -1
  11. package/dist/components/d-flow-file/DFlowTabTrigger.js +1 -1
  12. package/dist/components/d-flow-file/DFlowTabs.js +58 -106
  13. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +1 -1
  14. package/dist/components/d-flow-folder/DFlowFolderCreateDialog.js +52 -50
  15. package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.js +43 -38
  16. package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +3 -2
  17. package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +26 -22
  18. package/dist/components/d-flow-function/DFlowFunction.service.js +3 -2
  19. package/dist/components/d-flow-input/DFlowInputDataType.js +15 -14
  20. package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +3 -2
  21. package/dist/components/d-flow-input/DFlowInputDefault.js +1 -1
  22. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +1 -1
  23. package/dist/components/d-flow-node/DFlowNode.return.hook.js +1 -1
  24. package/dist/components/d-flow-node/DFlowNodeDefaultCard.js +1 -1
  25. package/dist/components/d-flow-panel/DFlowExport.js +1 -1
  26. package/dist/components/d-flow-panel/DFlowPanelControl.js +1 -1
  27. package/dist/components/d-flow-panel/DFlowPanelUpdate.js +1 -1
  28. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +1 -1
  29. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +1 -1
  30. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +1 -1
  31. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +1 -1
  32. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +6 -5
  33. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +3 -2
  34. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +1 -1
  35. package/dist/components/d-flow-type/DFlowType.service.d.ts +3 -3
  36. package/dist/components/d-flow-type/DFlowType.service.js +3 -2
  37. package/dist/components/d-flow-type/DFlowType.view.d.ts +4 -1
  38. package/dist/components/d-flow-type/DFlowType.view.js +16 -10
  39. package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
  40. package/dist/components/d-flow-validation/DFlowValidation.js +3 -2
  41. package/dist/components/d-flow-validation/DNodeValidation.hook.js +1 -1
  42. package/dist/components/d-license/DNamespaceLicense.service.js +3 -2
  43. package/dist/components/d-member/DNamespaceMember.service.js +1 -0
  44. package/dist/components/d-member/DNamespaceMemberContent.js +3 -2
  45. package/dist/components/d-member/DNamespaceMemberList.js +5 -4
  46. package/dist/components/d-namespace/DNamespace.service.js +3 -2
  47. package/dist/components/d-organization/DOrganization.service.js +3 -2
  48. package/dist/components/d-organization/DOrganizationList.js +7 -6
  49. package/dist/components/d-organization/DOrganizatonContent.js +3 -2
  50. package/dist/components/d-organization/index.js +9 -8
  51. package/dist/components/d-project/DNamespaceProject.service.js +3 -2
  52. package/dist/components/d-project/DNamespaceProject.view.d.ts +7 -1
  53. package/dist/components/d-project/DNamespaceProject.view.js +7 -1
  54. package/dist/components/d-project/DNamespaceProjectContent.js +3 -2
  55. package/dist/components/d-project/DNamespaceProjectList.js +3 -2
  56. package/dist/components/d-project/index.js +10 -9
  57. package/dist/components/d-role/DNamespaceRole.service.js +3 -2
  58. package/dist/components/d-role/DNamespaceRoleContent.js +3 -2
  59. package/dist/components/d-role/DNamespaceRoleList.js +6 -5
  60. package/dist/components/d-runtime/DRuntimeContent.js +3 -2
  61. package/dist/components/d-runtime/DRuntimeList.js +3 -2
  62. package/dist/components/d-user/DUser.service.js +3 -2
  63. package/dist/components/d-user/DUserContent.js +6 -5
  64. package/dist/components/d-user/DUserInput.js +3 -2
  65. package/dist/components/d-user/DUserList.js +5 -4
  66. package/dist/components/d-user/DUserMenu.js +5 -4
  67. package/dist/components/d-user/index.js +15 -14
  68. package/dist/components/form/index.d.ts +1 -0
  69. package/dist/components/form/index.js +25 -23
  70. package/dist/index.js +178 -181
  71. package/dist/utils/index.js +19 -24
  72. package/dist/utils/utils.d.ts +3 -18
  73. package/dist/utils/utils.js +101 -176
  74. package/package.json +16 -14
@@ -1,211 +1,132 @@
1
- import p from "react";
2
- import u from "merge-props";
3
- const $ = (i) => {
4
- const r = /-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/, o = parseFloat(i), n = i.match(r) || [], t = n.length > 0 ? i.substr(n[0]?.length ?? 0).trim() : "";
5
- return [o, t];
6
- }, C = (i, r, o, n) => {
7
- let t, a = !1;
8
- return p.Children.forEach(i, (m, g) => {
9
- let e = !0;
10
- if (p.isValidElement(m) && n)
11
- for (const c in n) {
12
- const h = n[c];
13
- if (!m.props[c] || m.props[c] != h) {
14
- e = !1;
15
- break;
16
- }
17
- }
18
- if (p.isValidElement(m) && m.type == r && e)
19
- t = m, a = !0;
20
- else if (p.Children.count(i) - 1 == g && !a && !t && o) throw new Error(`${r.name} is required`);
21
- }), t;
22
- }, E = (i, ...r) => {
23
- const o = p.Children.toArray(i).filter((n) => p.isValidElement(n) ? !r.find((t) => t == n.type) : !0);
24
- return o.length == 0 ? null : o;
25
- }, b = (i) => ({
26
- ...i.m ? {
27
- margin: `${i.m}rem`
1
+ import t from "merge-props";
2
+ import { md5 as p } from "js-md5";
3
+ const c = (m) => ({
4
+ ...m.m ? {
5
+ margin: `${m.m}rem`
28
6
  } : {},
29
- ...i.my ? {
30
- marginTop: `${i.my}rem`,
31
- marginBottom: `${i.my}rem`
7
+ ...m.my ? {
8
+ marginTop: `${m.my}rem`,
9
+ marginBottom: `${m.my}rem`
32
10
  } : {},
33
- ...i.mx ? {
34
- marginLeft: `${i.mx}rem`,
35
- marginRight: `${i.mx}rem`
11
+ ...m.mx ? {
12
+ marginLeft: `${m.mx}rem`,
13
+ marginRight: `${m.mx}rem`
36
14
  } : {},
37
- ...i.mt ? {
38
- marginTop: `${i.mt}rem`
15
+ ...m.mt ? {
16
+ marginTop: `${m.mt}rem`
39
17
  } : {},
40
- ...i.mb ? {
41
- marginBottom: `${i.mb}rem`
18
+ ...m.mb ? {
19
+ marginBottom: `${m.mb}rem`
42
20
  } : {},
43
- ...i.ml ? {
44
- marginLeft: `${i.ml}rem`
21
+ ...m.ml ? {
22
+ marginLeft: `${m.ml}rem`
45
23
  } : {},
46
- ...i.mr ? {
47
- marginRight: `${i.mr}rem`
24
+ ...m.mr ? {
25
+ marginRight: `${m.mr}rem`
48
26
  } : {},
49
- ...i.p ? {
50
- padding: `${i.p}rem`
27
+ ...m.p ? {
28
+ padding: `${m.p}rem`
51
29
  } : {},
52
- ...i.py ? {
53
- paddingTop: `${i.py}rem`,
54
- paddingBottom: `${i.py}rem`
30
+ ...m.py ? {
31
+ paddingTop: `${m.py}rem`,
32
+ paddingBottom: `${m.py}rem`
55
33
  } : {},
56
- ...i.px ? {
57
- paddingLeft: `${i.px}rem`,
58
- paddingRight: `${i.px}rem`
34
+ ...m.px ? {
35
+ paddingLeft: `${m.px}rem`,
36
+ paddingRight: `${m.px}rem`
59
37
  } : {},
60
- ...i.pt ? {
61
- paddingTop: `${i.pt}rem`
38
+ ...m.pt ? {
39
+ paddingTop: `${m.pt}rem`
62
40
  } : {},
63
- ...i.pb ? {
64
- paddingBottom: `${i.pb}rem`
41
+ ...m.pb ? {
42
+ paddingBottom: `${m.pb}rem`
65
43
  } : {},
66
- ...i.pl ? {
67
- paddingLeft: `${i.pl}rem`
44
+ ...m.pl ? {
45
+ paddingLeft: `${m.pl}rem`
68
46
  } : {},
69
- ...i.pr ? {
70
- paddingRight: `${i.pr}rem`
47
+ ...m.pr ? {
48
+ paddingRight: `${m.pr}rem`
71
49
  } : {},
72
- ...i.bg ? {
73
- backgroundColor: i.bg
50
+ ...m.bg ? {
51
+ backgroundColor: m.bg
74
52
  } : {},
75
- ...i.c ? {
76
- color: i.c
53
+ ...m.c ? {
54
+ color: m.c
77
55
  } : {},
78
- ...i.opacity ? {
79
- opacity: i.opacity
56
+ ...m.opacity ? {
57
+ opacity: m.opacity
80
58
  } : {},
81
- ...i.ff ? {
82
- fontFamily: i.ff
59
+ ...m.ff ? {
60
+ fontFamily: m.ff
83
61
  } : {},
84
- ...i.fz ? {
85
- fontSize: `${i.fz}rem`
62
+ ...m.fz ? {
63
+ fontSize: `${m.fz}rem`
86
64
  } : {},
87
- ...i.ta ? {
88
- textAlign: i.ta
65
+ ...m.ta ? {
66
+ textAlign: m.ta
89
67
  } : {},
90
- ...i.w ? {
91
- width: i.w
68
+ ...m.w ? {
69
+ width: m.w
92
70
  } : {},
93
- ...i.miw ? {
94
- minWidth: i.miw
71
+ ...m.miw ? {
72
+ minWidth: m.miw
95
73
  } : {},
96
- ...i.maw ? {
97
- maxWidth: i.maw
74
+ ...m.maw ? {
75
+ maxWidth: m.maw
98
76
  } : {},
99
- ...i.h ? {
100
- height: i.h
77
+ ...m.h ? {
78
+ height: m.h
101
79
  } : {},
102
- ...i.mih ? {
103
- minHeight: i.mih
80
+ ...m.mih ? {
81
+ minHeight: m.mih
104
82
  } : {},
105
- ...i.mah ? {
106
- maxHeight: i.mah
83
+ ...m.mah ? {
84
+ maxHeight: m.mah
107
85
  } : {},
108
- ...i.pos ? {
109
- position: i.pos
86
+ ...m.pos ? {
87
+ position: m.pos
110
88
  } : {},
111
- ...i.top ? {
112
- top: i.top
89
+ ...m.top ? {
90
+ top: m.top
113
91
  } : {},
114
- ...i.left ? {
115
- left: i.left
92
+ ...m.left ? {
93
+ left: m.left
116
94
  } : {},
117
- ...i.bottom ? {
118
- bottom: i.bottom
95
+ ...m.bottom ? {
96
+ bottom: m.bottom
119
97
  } : {},
120
- ...i.right ? {
121
- right: i.right
98
+ ...m.right ? {
99
+ right: m.right
122
100
  } : {},
123
- ...i.display ? {
124
- display: i.display
101
+ ...m.display ? {
102
+ display: m.display
125
103
  } : {},
126
- ...i.flex ? {
127
- flex: i.flex
104
+ ...m.flex ? {
105
+ flex: m.flex
128
106
  } : {},
129
- ...i.align ? {
130
- alignItems: i.align
107
+ ...m.align ? {
108
+ alignItems: m.align
131
109
  } : {},
132
- ...i.justify ? {
133
- justifyContent: i.justify
110
+ ...m.justify ? {
111
+ justifyContent: m.justify
134
112
  } : {},
135
- ...i.tf ? {
136
- transform: i.tf
113
+ ...m.tf ? {
114
+ transform: m.tf
137
115
  } : {}
138
- }), F = (i, r) => {
139
- const o = b(r), n = {
116
+ }), b = (m, r) => {
117
+ const i = c(r), o = {
140
118
  ...r
141
119
  };
142
120
  return ["m", "my", "mx", "mt", "mb", "ml", "mr", "p", "py", "px", "pt", "pb", "pl", "pr", "bg", "c", "opacity", "ff", "fz", "fw", "lts", "ta", "lh", "fs", "tt", "td", "w", "miw", "maw", "h", "mih", "mah", "bgsz", "bgp", "bgr", "bga", "pos", "top", "left", "bottom", "right", "inset", "display", "flex", "align", "justify", "tf"].forEach((a) => {
143
- delete n[a];
144
- }), u(n, {
145
- className: i,
146
- ...Object.keys(o).length !== 0 ? {
147
- style: o
121
+ delete o[a];
122
+ }), t(o, {
123
+ className: m,
124
+ ...Object.keys(i).length !== 0 ? {
125
+ style: i
148
126
  } : {}
149
127
  });
150
- }, x = () => ({
151
- height: window.innerHeight,
152
- width: window.innerWidth
153
- }), f = (i) => ({
154
- width: i.offsetWidth,
155
- height: i.offsetHeight,
156
- x: i.getBoundingClientRect().left,
157
- y: i.getBoundingClientRect().top
158
- }), R = (i, r, o = "bottom") => {
159
- const t = f(i), a = f(r), m = x(), g = [{
160
- name: "bottom",
161
- hierarchy: ["top", "left", "right"],
162
- calculationY: t.y + t.height + 8,
163
- calculationX: t.x,
164
- conditionFit: t.y + t.height + 8 + a.height <= m.height
165
- }, {
166
- name: "top",
167
- hierarchy: ["bottom", "left", "right"],
168
- calculationY: t.y - 8 - a.height,
169
- calculationX: t.x,
170
- conditionFit: t.y - 8 - a.height >= 0
171
- }, {
172
- name: "left",
173
- hierarchy: ["right", "bottom", "top"],
174
- calculationY: t.y,
175
- calculationX: t.x - 8 - a.width,
176
- conditionFit: t.x - 8 - a.width >= 0
177
- }, {
178
- name: "right",
179
- hierarchy: ["left", "bottom", "top"],
180
- calculationY: t.y,
181
- calculationX: t.x + 8 + t.width,
182
- conditionFit: t.x + t.width + 8 + a.width <= m.width
183
- }], e = g.find((c) => c.name == o);
184
- if (!e) return {
185
- position: "bottom",
186
- y: g[0].calculationY,
187
- x: g[0].calculationX
188
- };
189
- if (e.conditionFit) return {
190
- position: o,
191
- y: e.calculationY,
192
- x: e.calculationX
193
- };
194
- for (let c = 0; c < e.hierarchy.length; c++) {
195
- const h = g.find((d) => d.name == e.hierarchy[c]);
196
- if (h?.conditionFit) return {
197
- position: h.name,
198
- y: h.calculationY,
199
- x: h.calculationX
200
- };
201
- }
202
- return {
203
- position: "bottom",
204
- y: g[0].calculationY,
205
- x: g[0].calculationX
206
- };
207
- }, X = (i) => {
208
- switch (i) {
128
+ }, x = (m) => {
129
+ switch (m) {
209
130
  case "xxs":
210
131
  return "0.35rem";
211
132
  case "xs":
@@ -219,16 +140,20 @@ const $ = (i) => {
219
140
  case "xl":
220
141
  return "1.3rem";
221
142
  default:
222
- return i;
143
+ return m;
223
144
  }
145
+ }, f = 137.50776405003785, h = (m) => {
146
+ const r = m.match(/\/(\d+)\s*$/);
147
+ return r ? Number(r[1]) : null;
148
+ }, e = (m, r = 25, i = 320) => {
149
+ const o = i - r, n = h(m);
150
+ if (n != null)
151
+ return `hsl(${r + n * f % o}, 100%, 72%)`;
152
+ const a = p(p(m)), g = parseInt(a.slice(0, 8), 16);
153
+ return `hsl(${r + g % o}, 100%, 72%)`;
224
154
  };
225
155
  export {
226
- C as getChild,
227
- E as getContent,
228
- X as getDOMSizeFromCodeZeroSize,
229
- R as getPositionAroundTarget,
230
- f as getPositioning,
231
- x as getWindowPositioning,
232
- F as mergeCode0Props,
233
- $ as parseUnit
156
+ x as getDOMSizeFromCodeZeroSize,
157
+ e as hashToColor,
158
+ b as mergeCode0Props
234
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.0.0-mvp.43",
3
+ "version": "0.0.0-mvp.45",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -23,7 +23,12 @@
23
23
  "@code0-tech/sagittarius-graphql-types": "^0.0.0-703d578a55a3f0f20be3cb6892418f9e04d25716",
24
24
  "@codemirror/autocomplete": "^6.20.0",
25
25
  "@codemirror/lang-json": "^6.0.2",
26
+ "@codemirror/language": "^6.12.1",
27
+ "@codemirror/lint": "^6.9.4",
28
+ "@codemirror/state": "^6.5.4",
29
+ "@codemirror/view": "^6.39.13",
26
30
  "@dagrejs/dagre": "^2.0.3",
31
+ "@lezer/common": "^1.5.1",
27
32
  "@mdx-js/react": "^3.1.1",
28
33
  "@monaco-editor/react": "^4.7.0",
29
34
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -51,7 +56,7 @@
51
56
  "@storybook/react-vite": "^10.1.11",
52
57
  "@tabler/icons-react": "3.36.1",
53
58
  "@types/jest-image-snapshot": "^6.4.1",
54
- "@types/react": "^19.2.8",
59
+ "@types/react": "^19.2.14",
55
60
  "@types/react-dom": "^19.2.3",
56
61
  "@types/react-syntax-highlighter": "^15.5.13",
57
62
  "@uiw/codemirror-themes": "^4.25.4",
@@ -74,14 +79,14 @@
74
79
  "merge-props": "^6.0.0",
75
80
  "overlap-area": "^1.1.0",
76
81
  "playwright": "1.58.1",
77
- "react": "^19.2.3",
82
+ "react": "^19.2.4",
78
83
  "react-contenteditable": "^3.3.7",
79
- "react-dom": "^19.2.3",
84
+ "react-dom": "^19.2.4",
80
85
  "react-resizable-panels": "^4.6.2",
81
86
  "react-syntax-highlighter": "^16.1.0",
82
87
  "react-zoom-pan-pinch": "^3.7.0",
83
88
  "rimraf": "^6.1.2",
84
- "sass": "^1.97.2",
89
+ "sass": "^1.97.3",
85
90
  "sass-loader": "^16.0.6",
86
91
  "sonner": "^2.0.7",
87
92
  "storybook": "^10.1.11",
@@ -93,11 +98,7 @@
93
98
  "vite-plugin-dts": "^4.5.4",
94
99
  "vite-plugin-lib-inject-css": "^2.2.2",
95
100
  "vitest": "^4.0.17",
96
- "@codemirror/lint": "^6.9.4",
97
- "@codemirror/language": "^6.12.1",
98
- "@codemirror/state": "^6.5.4",
99
- "@codemirror/view": "^6.39.13",
100
- "@lezer/common": "^1.5.1"
101
+ "avvvatars-react": "^0.4.2"
101
102
  },
102
103
  "main": "dist/index.js",
103
104
  "repository": {
@@ -112,11 +113,11 @@
112
113
  "@ariakit/react": "^0.4.17",
113
114
  "@code0-tech/sagittarius-graphql-types": "0.0.0-703d578a55a3f0f20be3cb6892418f9e04d25716",
114
115
  "@codemirror/autocomplete": "^6.20.0",
115
- "@codemirror/lint": "^6.9.4",
116
- "@codemirror/view": "^6.39.13",
117
116
  "@codemirror/lang-json": "^6.0.2",
118
- "@codemirror/state": "^6.5.4",
119
117
  "@codemirror/language": "^6.12.1",
118
+ "@codemirror/lint": "^6.9.4",
119
+ "@codemirror/state": "^6.5.4",
120
+ "@codemirror/view": "^6.39.13",
120
121
  "@monaco-editor/react": "^4.7.0",
121
122
  "@radix-ui/react-checkbox": "^1.3.3",
122
123
  "@radix-ui/react-context-menu": "^2.2.16",
@@ -144,7 +145,8 @@
144
145
  "react-resizable-panels": "^4.3.1",
145
146
  "react-syntax-highlighter": "^16.1.0",
146
147
  "react-zoom-pan-pinch": "^3.7.0",
147
- "sonner": "^2.0.7"
148
+ "sonner": "^2.0.7",
149
+ "avvvatars-react": "^0.4.2"
148
150
  },
149
151
  "publishConfig": {
150
152
  "access": "public"