@kestra-io/ui-libs 0.0.83 → 0.0.88

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 (138) hide show
  1. package/dist/assets/icons/SplitCellsHorizontal.vue.d.ts +5 -0
  2. package/dist/assets/icons/SplitCellsHorizontal.vue.d.ts.map +1 -0
  3. package/dist/assets/icons/SplitCellsVertical.vue.d.ts +5 -0
  4. package/dist/assets/icons/SplitCellsVertical.vue.d.ts.map +1 -0
  5. package/dist/components/buttons/AddTaskButton.vue.d.ts +6 -0
  6. package/dist/components/buttons/AddTaskButton.vue.d.ts.map +1 -0
  7. package/dist/components/content/Alert.vue.d.ts +21 -0
  8. package/dist/components/content/Alert.vue.d.ts.map +1 -0
  9. package/dist/components/content/Collapse.vue.d.ts +21 -0
  10. package/dist/components/content/Collapse.vue.d.ts.map +1 -0
  11. package/dist/components/content/ConfigPropertyCard.vue.d.ts +11 -0
  12. package/dist/components/content/ConfigPropertyCard.vue.d.ts.map +1 -0
  13. package/dist/components/content/MDCRenderer.vue.d.ts +3 -0
  14. package/dist/components/content/MDCRenderer.vue.d.ts.map +1 -0
  15. package/dist/components/content/Mermaid.vue.d.ts +18 -0
  16. package/dist/components/content/Mermaid.vue.d.ts.map +1 -0
  17. package/dist/components/content/NextLink.vue.d.ts +18 -0
  18. package/dist/components/content/NextLink.vue.d.ts.map +1 -0
  19. package/dist/components/content/ProseBlockquote.vue.d.ts +18 -0
  20. package/dist/components/content/ProseBlockquote.vue.d.ts.map +1 -0
  21. package/dist/components/content/ProseCode.vue.d.ts +18 -0
  22. package/dist/components/content/ProseCode.vue.d.ts.map +1 -0
  23. package/dist/components/content/ProsePre.vue.d.ts +31 -0
  24. package/dist/components/content/ProsePre.vue.d.ts.map +1 -0
  25. package/dist/components/content/ProseTable.vue.d.ts +18 -0
  26. package/dist/components/content/ProseTable.vue.d.ts.map +1 -0
  27. package/dist/components/index.d.ts +9 -0
  28. package/dist/components/index.d.ts.map +1 -0
  29. package/dist/components/misc/Duration.vue.d.ts +6 -0
  30. package/dist/components/misc/Duration.vue.d.ts.map +1 -0
  31. package/dist/components/misc/ExecutionInformations.vue.d.ts +14 -0
  32. package/dist/components/misc/ExecutionInformations.vue.d.ts.map +1 -0
  33. package/dist/components/misc/State.vue.d.ts +8 -0
  34. package/dist/components/misc/State.vue.d.ts.map +1 -0
  35. package/dist/components/misc/TaskIcon.vue.d.ts +13 -0
  36. package/dist/components/misc/TaskIcon.vue.d.ts.map +1 -0
  37. package/dist/components/misc/Tooltip.vue.d.ts +29 -0
  38. package/dist/components/misc/Tooltip.vue.d.ts.map +1 -0
  39. package/dist/components/nodes/BasicNode.vue.d.ts +71 -0
  40. package/dist/components/nodes/BasicNode.vue.d.ts.map +1 -0
  41. package/dist/components/nodes/ClusterNode.vue.d.ts +49 -0
  42. package/dist/components/nodes/ClusterNode.vue.d.ts.map +1 -0
  43. package/dist/components/nodes/CollapsedClusterNode.vue.d.ts +190 -0
  44. package/dist/components/nodes/CollapsedClusterNode.vue.d.ts.map +1 -0
  45. package/dist/components/nodes/DependenciesNode.vue.d.ts +65 -0
  46. package/dist/components/nodes/DependenciesNode.vue.d.ts.map +1 -0
  47. package/dist/components/nodes/DotNode.vue.d.ts +133 -0
  48. package/dist/components/nodes/DotNode.vue.d.ts.map +1 -0
  49. package/dist/components/nodes/EdgeNode.vue.d.ts +103 -0
  50. package/dist/components/nodes/EdgeNode.vue.d.ts.map +1 -0
  51. package/dist/components/nodes/TaskNode.vue.d.ts +202 -0
  52. package/dist/components/nodes/TaskNode.vue.d.ts.map +1 -0
  53. package/dist/components/nodes/TriggerNode.vue.d.ts +170 -0
  54. package/dist/components/nodes/TriggerNode.vue.d.ts.map +1 -0
  55. package/dist/components/plugins/PropertyDetail.vue.d.ts +32 -0
  56. package/dist/components/plugins/PropertyDetail.vue.d.ts.map +1 -0
  57. package/dist/components/plugins/PropertyType.vue.d.ts +31 -0
  58. package/dist/components/plugins/PropertyType.vue.d.ts.map +1 -0
  59. package/dist/components/plugins/SchemaToCode.vue.d.ts +22 -0
  60. package/dist/components/plugins/SchemaToCode.vue.d.ts.map +1 -0
  61. package/dist/components/plugins/SchemaToHtml.vue.d.ts +53 -0
  62. package/dist/components/plugins/SchemaToHtml.vue.d.ts.map +1 -0
  63. package/dist/components/topology/Topology.vue.d.ts +157 -0
  64. package/dist/components/topology/Topology.vue.d.ts.map +1 -0
  65. package/dist/composables/getMDCParser.d.ts +3 -0
  66. package/dist/composables/getMDCParser.d.ts.map +1 -0
  67. package/dist/composables/useMarkdownParser.d.ts +4 -0
  68. package/dist/composables/useMarkdownParser.d.ts.map +1 -0
  69. package/dist/index.d.ts +8 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/kestra-ui.js +15093 -10840
  72. package/dist/kestra-ui.js.map +1 -1
  73. package/dist/kestra-ui.umd.cjs +47 -21
  74. package/dist/kestra-ui.umd.cjs.map +1 -1
  75. package/dist/style.css +1 -1
  76. package/dist/utils/Utils.d.ts +14 -0
  77. package/dist/utils/Utils.d.ts.map +1 -0
  78. package/dist/utils/VueFlowUtils.d.ts +93 -0
  79. package/dist/utils/VueFlowUtils.d.ts.map +1 -0
  80. package/dist/utils/YamlUtils.d.ts +42 -0
  81. package/dist/utils/YamlUtils.d.ts.map +1 -0
  82. package/dist/utils/constants.d.ts +33 -0
  83. package/dist/utils/constants.d.ts.map +1 -0
  84. package/dist/utils/global.d.ts +14 -0
  85. package/dist/utils/global.d.ts.map +1 -0
  86. package/dist/utils/state.d.ts +42 -0
  87. package/dist/utils/state.d.ts.map +1 -0
  88. package/package.json +45 -9
  89. package/src/components/buttons/AddTaskButton.vue +10 -15
  90. package/src/components/content/Alert.vue +8 -10
  91. package/src/components/content/Collapse.vue +10 -23
  92. package/src/components/content/ConfigPropertyCard.vue +8 -19
  93. package/src/components/content/MDCRenderer.vue +3 -2
  94. package/src/components/content/Mermaid.vue +2 -2
  95. package/src/components/content/NextLink.vue +1 -7
  96. package/src/components/content/ProseBlockquote.vue +0 -3
  97. package/src/components/content/ProsePre.vue +56 -73
  98. package/src/components/content/ProseTable.vue +0 -3
  99. package/src/components/index.ts +19 -0
  100. package/src/components/misc/Duration.vue +86 -86
  101. package/src/components/misc/ExecutionInformations.vue +94 -87
  102. package/src/components/misc/State.vue +47 -45
  103. package/src/components/misc/TaskIcon.vue +68 -83
  104. package/src/components/misc/Tooltip.vue +32 -34
  105. package/src/components/nodes/BasicNode.vue +5 -5
  106. package/src/components/nodes/ClusterNode.vue +3 -3
  107. package/src/components/nodes/CollapsedClusterNode.vue +3 -3
  108. package/src/components/nodes/DependenciesNode.vue +42 -45
  109. package/src/components/nodes/EdgeNode.vue +35 -35
  110. package/src/components/nodes/TaskNode.vue +8 -8
  111. package/src/components/nodes/TriggerNode.vue +4 -4
  112. package/src/components/plugins/PropertyDetail.vue +16 -23
  113. package/src/components/plugins/PropertyType.vue +32 -8
  114. package/src/components/plugins/SchemaToCode.vue +56 -77
  115. package/src/components/plugins/SchemaToHtml.vue +38 -14
  116. package/src/components/topology/Topology.vue +140 -126
  117. package/src/composables/getMDCParser.ts +13 -0
  118. package/src/composables/{useMarkdownParser.js → useMarkdownParser.ts} +39 -33
  119. package/src/index.ts +9 -0
  120. package/src/material-icons.d.ts +5 -0
  121. package/src/scss/color-palette.scss +73 -0
  122. package/src/scss/theme-dark.scss +160 -0
  123. package/src/scss/theme-light.scss +160 -0
  124. package/src/utils/Utils.ts +80 -0
  125. package/src/utils/VueFlowUtils.ts +707 -0
  126. package/src/utils/YamlUtils.ts +643 -0
  127. package/src/utils/{constants.js → constants.ts} +16 -18
  128. package/src/utils/global.ts +36 -0
  129. package/src/utils/{state.js → state.ts} +17 -8
  130. package/src/vite.d.ts +1 -0
  131. package/dist/_theme-dark.scss +0 -20
  132. package/dist/_variables.scss +0 -119
  133. package/src/components/index.js +0 -29
  134. package/src/index.js +0 -7
  135. package/src/utils/Utils.js +0 -62
  136. package/src/utils/VueFlowUtils.js +0 -502
  137. package/src/utils/YamlUtils.js +0 -554
  138. package/src/utils/global.js +0 -23
@@ -0,0 +1,36 @@
1
+ declare global {
2
+ interface String {
3
+ capitalize(): string
4
+ hashCode(): string
5
+ }
6
+ }
7
+
8
+ String.prototype.capitalize = function () {
9
+ return this.charAt(0).toUpperCase() + this.slice(1)
10
+ }
11
+
12
+ String.prototype.hashCode = function () {
13
+ let hash = 0;
14
+ if (this.length === 0) {
15
+ return "0";
16
+ }
17
+ for (let i = 0; i < this.length; i++) {
18
+ const char = this.charCodeAt(i);
19
+ hash = ((hash << 5) - hash) + char;
20
+ hash = hash & hash; // Convert to 32bit integer
21
+ }
22
+ return hash + "";
23
+ }
24
+
25
+ /**
26
+ * Get the value of a CSS variable
27
+ * @deprecated if you can use the variable itself in the style tag, use it instead
28
+ * @param name - The name of the CSS variable
29
+ * @returns The value of the CSS variable
30
+ */
31
+ export const cssVariable = (name:string) => {
32
+ const root = document.querySelector(":root");
33
+ const rootStyle = root ? getComputedStyle(root) : null;
34
+
35
+ return rootStyle?.getPropertyValue(name);
36
+ }
@@ -8,7 +8,16 @@ import SkipPreviousCircle from "vue-material-design-icons/SkipPreviousCircle.vue
8
8
  import AlertCircle from "vue-material-design-icons/AlertCircle.vue";
9
9
  import DotsVerticalCircle from "vue-material-design-icons/DotsVerticalCircle.vue";
10
10
 
11
- const STATE = Object.freeze({
11
+ interface StateModel {
12
+ name: string;
13
+ colorClass: string;
14
+ icon: any;
15
+ isRunning: boolean;
16
+ isKillable: boolean;
17
+ isFailed: boolean;
18
+ }
19
+
20
+ const STATE:Record<string, StateModel> = Object.freeze({
12
21
  CREATED: {
13
22
  name: "CREATED",
14
23
  colorClass: "cyan",
@@ -120,24 +129,24 @@ export default class State {
120
129
  return STATE.PAUSED.name;
121
130
  }
122
131
 
123
- static isRunning(state) {
132
+ static isRunning(state:string) {
124
133
  return STATE[state] && STATE[state].isRunning;
125
134
  }
126
135
 
127
- static isKillable(state) {
136
+ static isKillable(state:string) {
128
137
  return STATE[state] && STATE[state].isKillable;
129
138
  }
130
139
 
131
- static isPaused(state) {
140
+ static isPaused(state:string) {
132
141
  return STATE[state] && STATE[state] === STATE.PAUSED;
133
142
  }
134
143
 
135
- static isFailed(state) {
144
+ static isFailed(state:string) {
136
145
  return STATE[state] && STATE[state].isFailed;
137
146
  }
138
147
 
139
148
  static allStates() {
140
- return mapValues(STATE, state => {
149
+ return mapValues(STATE, (state:StateModel) => {
141
150
  return {
142
151
  key: state.name,
143
152
  icon: state.icon,
@@ -151,7 +160,7 @@ export default class State {
151
160
  }
152
161
 
153
162
  static colorClass() {
154
- return mapValues(STATE, state => state.colorClass);
163
+ return mapValues(STATE, (state: StateModel) => state.colorClass);
155
164
  }
156
165
 
157
166
  static color() {
@@ -159,6 +168,6 @@ export default class State {
159
168
  }
160
169
 
161
170
  static icon() {
162
- return mapValues(STATE, state => state.icon);
171
+ return mapValues(STATE, (state:StateModel) => state.icon);
163
172
  }
164
173
  }
package/src/vite.d.ts ADDED
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -1,20 +0,0 @@
1
- // gray
2
- $gray-900: #CAC5DA;
3
- $gray-800: #A69FC1;
4
- $gray-700: #918BA9;
5
- $gray-600: #404559;
6
- $gray-500: #2F3342;
7
- $gray-400: #2C303F;
8
- $gray-300: #202435;
9
- $gray-200: #21242E;
10
- $gray-100: #1C1E27;
11
-
12
- $light: $gray-200;
13
- $dark: $gray-100;
14
-
15
- // body
16
- $body-color: $gray-900;
17
- $border-color: $gray-600;
18
- $body-bg: $gray-200;
19
- $card-bg: $gray-500;
20
- $input-bg: $gray-100;
@@ -1,119 +0,0 @@
1
- // primary color
2
- $primary: #8405FF !default;
3
- $secondary: #C182FF !default;
4
- $tertiary: #2F3342 !default;
5
-
6
- // color system
7
- $blue: #1761FD !default;
8
- $indigo: #8405FF !default;
9
- $purple: #9F9DFF !default;
10
- $purple-36: #9CA1DE;
11
- $pink: #FD3C97 !default;
12
- $red: #E36065 !default;
13
- $red-light: #FF9D9D !default;
14
- $orange: #FCB37C !default;
15
- $yellow: #FCE07C !default;
16
- $green: #03DABA !default;
17
- $teal: #03D87F !default;
18
- $cyan: #60C5FE !default;
19
-
20
- // gray
21
- $white: #FFF !default;
22
- $gray-100: #F5F5FF !default;
23
- $gray-200: #f1f5fa !default;
24
- $gray-300: #E5E4F7 !default;
25
- $gray-400: #b6c2e4 !default;
26
- $gray-500: #8997bd !default;
27
- $gray-600: #7081b9 !default;
28
- $gray-700: #303e67 !default;
29
- $gray-800: #2c3652 !default;
30
- $gray-900: #1d2c48 !default;
31
- $black: #26282D !default;
32
-
33
- $light: $gray-200 !default;
34
- $dark: $gray-900 !default;
35
-
36
- $white-3: #B9B9BA;
37
-
38
- $black-2 : #161617;
39
- $black-3 : #252526;
40
-
41
- // fonts
42
- $font-size-base: 1rem !default;
43
- $font-family-sans-serif: "Public Sans", sans-serif;
44
- $font-family-monospace: "Source Code Pro", monospace;
45
- $font-size-xs: $font-size-base * 0.75 !default;
46
- $font-size-md : $font-size-base * 1;
47
- $font-size-xl: $font-size-base * 1.375;
48
-
49
- // border
50
- $block-border: 1px solid $black-3;
51
-
52
- // border radius
53
- $border-radius: 0.25rem !default;
54
- $border-radius-lg: 0.5rem !default;
55
- $border-radius-sm: 0.15rem !default;
56
-
57
- // layout
58
- $menu-width: 268px !default;
59
- $spacer: 1rem !default;
60
-
61
- // body
62
- $body-color: $gray-800 !default;
63
- $body-tertiary-color: #FFFFFF;
64
- $body-tertiary-bg: #785EEA;
65
- $border-color: $gray-300 !default;
66
- $body-bg: $gray-100 !default;
67
- $card-bg: $white !default;
68
- $input-bg: $white !default;
69
-
70
- // link
71
- $link-color: $primary !default;
72
- $link-decoration: none;
73
-
74
- // border radius
75
- $border-radius: .25rem !default;
76
- $border-radius-sm: .15rem !default;
77
-
78
- // shadow
79
- $box-shadow-sm: 0 .125rem .25rem rgba($black, .075);
80
- $box-shadow: 0 .5rem 1rem rgba($black, .15);
81
- $box-shadow-lg: 0 1rem 3rem rgba($black, .175);
82
-
83
- // boostrap flags
84
- $enable-reduced-motion: false;
85
-
86
- // element-plus
87
- $types: primary, success, warning, danger, error, info !default;
88
- $element-colors: (
89
- 'white': $white,
90
- 'black': $black,
91
- 'primary': (
92
- 'base': $primary,
93
- ),
94
- 'success': (
95
- 'base': $green,
96
- ),
97
- 'warning': (
98
- 'base': $orange,
99
- ),
100
- 'danger': (
101
- 'base': $red,
102
- ),
103
- 'error': (
104
- 'base': $red,
105
- ),
106
- 'info': (
107
- 'base': $cyan,
108
- ),
109
- );
110
-
111
- $popper-margin: .2rem;
112
-
113
- $baseline-max-width: 730px;
114
-
115
- // bootstrap
116
- @import "bootstrap/scss/functions";
117
- @import "bootstrap/scss/mixins";
118
- @import "bootstrap/scss/vendor/rfs";
119
- @import 'bootstrap/scss/variables';
@@ -1,29 +0,0 @@
1
- // nodes
2
- import ClusterNode from "./nodes/ClusterNode.vue";
3
- import DotNode from "./nodes/DotNode.vue";
4
- import EdgeNode from "./nodes/EdgeNode.vue";
5
- import TaskNode from "./nodes/TaskNode.vue";
6
- import TriggerNode from "./nodes/TriggerNode.vue"
7
- import BasicNode from "./nodes/BasicNode.vue";
8
- import CollapsedClusterNode from "./nodes/CollapsedClusterNode.vue";
9
- import DependenciesNode from "./nodes/DependenciesNode.vue"
10
-
11
- // Topology Component
12
- import Topology from "./topology/Topology.vue";
13
-
14
- // misc
15
- import ExecutionInformations from "./misc/ExecutionInformations.vue";
16
- import State from "./misc/State.vue";
17
- import TaskIcon from "./misc/TaskIcon.vue";
18
-
19
- // buttons
20
- import AddTaskButton from "./buttons/AddTaskButton.vue";
21
-
22
- // plugins
23
- import SchemaToHtml from "./plugins/SchemaToHtml.vue";
24
-
25
- export {ClusterNode, DotNode, EdgeNode, TaskNode, TriggerNode, BasicNode, CollapsedClusterNode, DependenciesNode};
26
- export {Topology}
27
- export {ExecutionInformations, State, TaskIcon};
28
- export {AddTaskButton};
29
- export {SchemaToHtml};
package/src/index.js DELETED
@@ -1,7 +0,0 @@
1
- import YamlUtils from "./utils/YamlUtils.js";
2
- import Utils from "./utils/Utils.js";
3
- import VueFlowUtils from "./utils/VueFlowUtils.js";
4
-
5
- export {YamlUtils, Utils, VueFlowUtils};
6
-
7
- export * from "./components/index.js";
@@ -1,62 +0,0 @@
1
- import humanizeDuration from "humanize-duration";
2
- import moment from "moment";
3
-
4
- const humanizeDurationLanguages = {
5
- "en" : {
6
- y: () => "y",
7
- mo: () => "mo",
8
- w: () => "w",
9
- d: () => "d",
10
- h: () => "h",
11
- m: () => "m",
12
- s: () => "s",
13
- ms: () => "ms",
14
- },
15
- "fr" : {
16
- y: () => "a",
17
- mo: () => "mo",
18
- w: () => "se",
19
- d: () => "j",
20
- h: () => "h",
21
- m: () => "m",
22
- s: () => "s",
23
- ms: () => "ms",
24
- }
25
- }
26
- export default class Utils {
27
- static splitFirst(str, separator) {
28
- return str.split(separator).slice(1).join(separator);
29
- }
30
-
31
- static duration(isoString) {
32
- return moment.duration(isoString, moment.ISO_8601).asMilliseconds() / 1000
33
- }
34
-
35
- static humanDuration(value, options) {
36
- options = options || {maxDecimalPoints: 2};
37
- options.spacer = "";
38
- options.language = localStorage.getItem("lang") || "en";
39
- options.languages = humanizeDurationLanguages;
40
- options.largest = 2;
41
-
42
- if (typeof (value) !== "number") {
43
- value = Utils.duration(value);
44
- }
45
-
46
- return humanizeDuration(value * 1000, options).replace(/\.([0-9])s$/i, ".$10s")
47
- }
48
-
49
- static afterLastDot(str) {
50
- return str.split(".").pop();
51
- }
52
-
53
- static translate(text) {
54
- /* eslint-disable */
55
- if (typeof $t !== "undefined" && typeof $t === "function") {
56
- return $t(text);
57
- /* eslint-enable */
58
- } else {
59
- return text;
60
- }
61
- }
62
- }