glib-web 2.5.0 → 3.0.0-beta1

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 (209) hide show
  1. package/.eslintrc.js +0 -0
  2. package/LICENSE +0 -0
  3. package/README.md +0 -0
  4. package/action.js +6 -1
  5. package/actions/analytics/logEvent.js +0 -0
  6. package/actions/auth/creditCard.js +0 -0
  7. package/actions/auth/restart.js +0 -0
  8. package/actions/auth/saveCsrfToken.js +0 -0
  9. package/actions/cables/push.js +0 -0
  10. package/actions/commands/copy.js +0 -0
  11. package/actions/commands/enqueue.js +17 -0
  12. package/actions/components/update.js +13 -14
  13. package/actions/dialogs/alert.js +0 -0
  14. package/actions/dialogs/close.js +0 -0
  15. package/actions/dialogs/notification.js +0 -0
  16. package/actions/dialogs/oauth.js +0 -0
  17. package/actions/dialogs/open.js +0 -0
  18. package/actions/dialogs/options.js +0 -0
  19. package/actions/dialogs/reload.js +0 -0
  20. package/actions/dialogs/show.js +0 -0
  21. package/actions/http/delete.js +0 -0
  22. package/actions/http/patch.js +0 -0
  23. package/actions/http/post.js +0 -0
  24. package/actions/http/put.js +0 -0
  25. package/actions/panels/scrollTo.js +0 -0
  26. package/actions/panels/scrollToBottom.js +0 -0
  27. package/actions/runMultiple.js +0 -0
  28. package/actions/sheets/select.js +0 -0
  29. package/actions/snackbars/alert.js +0 -0
  30. package/actions/snackbars/select.js +0 -0
  31. package/actions/timeouts/set.js +0 -0
  32. package/actions/tours/start.js +0 -0
  33. package/actions/windows/close.js +0 -0
  34. package/actions/windows/closeAll.js +0 -0
  35. package/actions/windows/closeWithReload.js +0 -0
  36. package/actions/windows/open.js +0 -0
  37. package/actions/windows/openWeb.js +0 -0
  38. package/actions/windows/print.js +0 -0
  39. package/actions/windows/refreshState.js +0 -0
  40. package/actions/windows/reload.js +0 -0
  41. package/actions/ws/push.js +0 -0
  42. package/app.vue +25 -26
  43. package/components/_button.vue +21 -28
  44. package/components/_chip.vue +14 -19
  45. package/components/_dropdownMenu.vue +10 -23
  46. package/components/_icon.vue +5 -5
  47. package/components/_message.vue +0 -0
  48. package/components/_responsive.vue +7 -21
  49. package/components/avatar.vue +11 -15
  50. package/components/banners/alert.vue +2 -7
  51. package/components/banners/select.vue +18 -30
  52. package/components/button.vue +5 -5
  53. package/components/calendar.vue +0 -0
  54. package/components/component.vue +96 -101
  55. package/components/datetime.vue +0 -0
  56. package/components/fab.vue +0 -0
  57. package/components/fields/_patternText.vue +5 -19
  58. package/components/fields/_select.vue +7 -28
  59. package/components/fields/autocomplete.vue +5 -21
  60. package/components/fields/check.vue +19 -11
  61. package/components/fields/country/countries.js +0 -0
  62. package/components/fields/country/field.vue +9 -27
  63. package/components/fields/country/regions.js +0 -0
  64. package/components/fields/creditCard.vue +0 -0
  65. package/components/fields/date.vue +5 -5
  66. package/components/fields/datetime.vue +5 -5
  67. package/components/fields/dynamicSelect.vue +8 -29
  68. package/components/fields/file.vue +0 -0
  69. package/components/fields/googlePlace.vue +0 -0
  70. package/components/fields/hidden.vue +0 -0
  71. package/components/fields/location.vue +0 -0
  72. package/components/fields/newRichText.vue +66 -53
  73. package/components/fields/otpField.vue +6 -14
  74. package/components/fields/phone/countries.js +0 -0
  75. package/components/fields/phone/field.vue +60 -78
  76. package/components/fields/phone/sprite.css +0 -0
  77. package/components/fields/radio.vue +16 -23
  78. package/components/fields/rating.vue +9 -16
  79. package/components/fields/richText.vue +8 -28
  80. package/components/fields/select.vue +10 -7
  81. package/components/fields/stripe/stripeFields.vue +0 -0
  82. package/components/fields/stripe/stripeIndividualFields.vue +0 -0
  83. package/components/fields/stripeExternalAccount.vue +10 -24
  84. package/components/fields/stripeToken.vue +0 -0
  85. package/components/fields/submit.vue +0 -0
  86. package/components/fields/text.vue +24 -40
  87. package/components/fields/textarea.vue +13 -27
  88. package/components/fields/timeZone.vue +9 -6
  89. package/components/fields/timer.vue +3 -10
  90. package/components/h1.vue +0 -0
  91. package/components/h2.vue +0 -0
  92. package/components/h3.vue +0 -0
  93. package/components/h5.vue +0 -0
  94. package/components/h6.vue +0 -0
  95. package/components/hr.vue +0 -0
  96. package/components/html.vue +0 -0
  97. package/components/icon.vue +0 -0
  98. package/components/image.vue +13 -20
  99. package/components/label.vue +0 -0
  100. package/components/markdown.vue +15 -8
  101. package/components/mixins/chart/annotation.js +0 -0
  102. package/components/mixins/chart/tooltip.js +0 -0
  103. package/components/mixins/dataset.js +0 -0
  104. package/components/mixins/events.js +17 -6
  105. package/components/mixins/extension.js +0 -0
  106. package/components/mixins/list/autoload.js +0 -0
  107. package/components/mixins/longClick.js +0 -0
  108. package/components/mixins/scrolling.js +0 -0
  109. package/components/mixins/styles.js +18 -15
  110. package/components/mixins/table/autoload.js +0 -0
  111. package/components/mixins/table/export.js +0 -0
  112. package/components/mixins/table/import.js +0 -0
  113. package/components/mixins/text.js +0 -0
  114. package/components/mixins/ws/actionCable.js +0 -0
  115. package/components/mixins/ws/phoenixSocket.js +0 -0
  116. package/components/multimedia/video.vue +0 -0
  117. package/components/p.vue +0 -0
  118. package/components/panels/carousel.vue +0 -0
  119. package/components/panels/column.vue +5 -5
  120. package/components/panels/custom.vue +15 -15
  121. package/components/panels/flow.vue +19 -13
  122. package/components/panels/form.vue +17 -28
  123. package/components/panels/grid.vue +15 -9
  124. package/components/panels/horizontal.vue +149 -18
  125. package/components/panels/list.vue +63 -70
  126. package/components/panels/responsive.vue +13 -33
  127. package/components/panels/scroll.vue +0 -0
  128. package/components/panels/split.vue +2 -2
  129. package/components/panels/table.vue +27 -61
  130. package/components/panels/timeline.vue +20 -30
  131. package/components/panels/vertical.vue +9 -14
  132. package/components/panels/web.vue +0 -0
  133. package/components/progressbar.vue +0 -0
  134. package/components/spacer.vue +0 -0
  135. package/components/switch.vue +0 -0
  136. package/components/tabBar.vue +27 -19
  137. package/index.js +68 -72
  138. package/keys.js +0 -0
  139. package/nav/appbar.vue +4 -4
  140. package/nav/dialog.vue +24 -34
  141. package/nav/drawer.vue +39 -51
  142. package/nav/drawerButton.vue +5 -7
  143. package/nav/drawerLabel.vue +2 -3
  144. package/nav/sheet.vue +18 -24
  145. package/nav/snackbar.vue +16 -26
  146. package/package.json +10 -11
  147. package/plugins/driverCustomBehavior.js +1 -1
  148. package/plugins/updatableComponent.js +1 -7
  149. package/plugins/vuetify.js +27 -0
  150. package/settings.json.example +0 -0
  151. package/static/plugins/alignment/alignment.js +0 -0
  152. package/static/plugins/alignment/alignment.min.js +0 -0
  153. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  154. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  155. package/static/plugins/blockcode/blockcode.js +0 -0
  156. package/static/plugins/blockcode/blockcode.min.js +0 -0
  157. package/static/plugins/clips/clips.js +0 -0
  158. package/static/plugins/clips/clips.min.js +0 -0
  159. package/static/plugins/counter/counter.js +0 -0
  160. package/static/plugins/counter/counter.min.js +0 -0
  161. package/static/plugins/definedlinks/definedlinks.js +0 -0
  162. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  163. package/static/plugins/handle/handle.js +0 -0
  164. package/static/plugins/handle/handle.min.js +0 -0
  165. package/static/plugins/icons/icons.js +0 -0
  166. package/static/plugins/icons/icons.min.js +0 -0
  167. package/static/plugins/imageposition/imageposition.js +0 -0
  168. package/static/plugins/imageposition/imageposition.min.js +0 -0
  169. package/static/plugins/inlineformat/inlineformat.js +0 -0
  170. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  171. package/static/plugins/removeformat/removeformat.js +0 -0
  172. package/static/plugins/removeformat/removeformat.min.js +0 -0
  173. package/static/plugins/selector/selector.js +0 -0
  174. package/static/plugins/selector/selector.min.js +0 -0
  175. package/static/plugins/specialchars/specialchars.js +0 -0
  176. package/static/plugins/specialchars/specialchars.min.js +0 -0
  177. package/static/plugins/textdirection/textdirection.js +0 -0
  178. package/static/plugins/textdirection/textdirection.min.js +0 -0
  179. package/static/plugins/textexpander/textexpander.js +0 -0
  180. package/static/plugins/textexpander/textexpander.min.js +0 -0
  181. package/static/plugins/underline/underline.js +0 -0
  182. package/static/plugins/underline/underline.min.js +0 -0
  183. package/static/redactorx.css +0 -0
  184. package/static/redactorx.js +0 -0
  185. package/static/redactorx.min.css +0 -0
  186. package/static/redactorx.min.js +0 -0
  187. package/static/redactorx.usm.min.js +0 -0
  188. package/styles/test.sass +0 -0
  189. package/styles/test.scss +0 -0
  190. package/templates/_menu.vue +0 -0
  191. package/templates/comment.vue +42 -19
  192. package/templates/featured.vue +8 -9
  193. package/templates/thumbnail-old.vue +188 -0
  194. package/templates/thumbnail.vue +5 -188
  195. package/templates/unsupported.vue +0 -0
  196. package/tsconfig.json +1 -1
  197. package/utils/dom.js +0 -0
  198. package/utils/eventBus.js +9 -2
  199. package/utils/helper.js +0 -0
  200. package/utils/history.js +7 -4
  201. package/utils/http.js +7 -2
  202. package/utils/launch.js +43 -51
  203. package/utils/mime_type.js +0 -0
  204. package/utils/private/ws.js +0 -0
  205. package/utils/public.js +6 -0
  206. package/utils/queue.js +110 -0
  207. package/utils/settings.js +3 -1
  208. package/utils/type.js +0 -0
  209. package/utils/uploader.js +0 -0
package/utils/launch.js CHANGED
@@ -1,8 +1,8 @@
1
- import Vue from "vue";
2
- import Dialog from "../nav/dialog";
3
- import Sheet from "../nav/sheet";
4
- import Snackbar from "../nav/snackbar";
5
- import Vuetify from "vuetify";
1
+ import { Vue } from "../index";
2
+ import Dialog from "../nav/dialog.vue";
3
+ import Sheet from "../nav/sheet.vue";
4
+ import Snackbar from "../nav/snackbar.vue";
5
+ import { createApp, h } from "vue";
6
6
 
7
7
  export default class {
8
8
  static get dialog() {
@@ -36,30 +36,27 @@ class LaunchDialog {
36
36
  this.stack = [];
37
37
  }
38
38
 
39
+
39
40
  // https://css-tricks.com/creating-vue-js-component-instances-programmatically/
40
- const DialogClass = Vue.extend(Dialog);
41
- const instance = new DialogClass({
42
- vuetify: new Vuetify({
43
- theme: {
44
- themes: Utils.settings.themes
41
+ const props = {
42
+ spec: properties,
43
+ stack: this.stack,
44
+ vueApp: window.vueApp
45
+ }
46
+
47
+ const instance = createApp(
48
+ {
49
+ render: function () {
50
+ return h(Dialog, props)
45
51
  }
46
- }),
47
- propsData: {
48
- spec: properties,
49
- stack: this.stack,
50
- vueApp: window.vueApp
51
52
  }
52
- });
53
+ )
54
+ Object.assign(instance._context, Vue._context)
53
55
 
54
56
  if (component) {
55
- // const placeholder = component
56
- // .$dialogContainer()
57
- // .appendChild(document.createElement("div"));
58
-
59
- const placeholder = component.$el.appendChild(
60
- document.createElement("div")
61
- );
62
- instance.$mount(placeholder);
57
+ const placeholder = document.createElement('div')
58
+ document.body.appendChild(placeholder)
59
+ instance.mount(placeholder);
63
60
  } else {
64
61
  console.error("A dialog has to be displayed in a component");
65
62
  }
@@ -108,21 +105,19 @@ class LaunchDialog {
108
105
 
109
106
  class LaunchSheet {
110
107
  static open(properties, component) {
111
- const SheetClass = Vue.extend(Sheet);
112
- const instance = new SheetClass({
113
- vuetify: new Vuetify({
114
- theme: {
115
- themes: Utils.settings.themes
108
+ const instance = createApp(
109
+ {
110
+ render: function () {
111
+ return h(Sheet, { spec: properties })
116
112
  }
117
- }),
118
- propsData: { spec: properties }
119
- });
113
+ }
114
+ )
115
+ Object.assign(instance._context, Vue._context)
120
116
 
121
117
  if (component) {
122
- const placeholder = component.$el.appendChild(
123
- document.createElement("div")
124
- );
125
- instance.$mount(placeholder);
118
+ const placeholder = document.createElement('div')
119
+ document.body.appendChild(placeholder)
120
+ instance.mount(placeholder);
126
121
  } else {
127
122
  console.error("A sheet has to be displayed in a component");
128
123
  }
@@ -150,25 +145,22 @@ class LaunchSheet {
150
145
 
151
146
  class LaunchSnackbar {
152
147
  static open(properties, component) {
153
- const SnackbarClass = Vue.extend(Snackbar);
154
- const instance = new SnackbarClass({
155
- vuetify: window.vueApp.vuetify,
156
- propsData: { spec: properties, vueApp: window.vueApp }
157
- });
148
+ const instance = createApp(
149
+ {
150
+ render: function () {
151
+ return h(Snackbar, { spec: properties, vueApp: window.vueApp })
152
+ }
153
+ }
154
+ )
155
+ Object.assign(instance._context, Vue._context)
158
156
 
159
157
  if (component) {
160
- // This doesn't seem to work when it is triggered from a list row's menu.
161
- // const placeholder = component.$el.appendChild(
162
- // document.createElement("div")
163
- // );
164
-
165
- const placeholder = document.body.appendChild(
166
- document.createElement("div")
167
- );
168
- instance.$mount(placeholder);
158
+ const placeholder = document.createElement('div')
159
+ document.body.appendChild(placeholder)
160
+ instance.mount(placeholder);
169
161
  instance.show = true;
170
162
  } else {
171
- console.error("A snackbar has to be displayed in a component");
163
+ console.error("A Snackbar has to be displayed in a component");
172
164
  }
173
165
 
174
166
  return instance;
File without changes
File without changes
package/utils/public.js CHANGED
@@ -5,6 +5,9 @@ import Type from "./type";
5
5
  import Form from "./form";
6
6
  import Component from "./component";
7
7
  import Hash from "./hash";
8
+ import Queue from "./queue";
9
+
10
+ const _queue = new Queue();
8
11
 
9
12
  export default class {
10
13
  static get action() {
@@ -28,4 +31,7 @@ export default class {
28
31
  static get Hash() {
29
32
  return Hash;
30
33
  }
34
+ static get queue() {
35
+ return _queue;
36
+ }
31
37
  }
package/utils/queue.js ADDED
@@ -0,0 +1,110 @@
1
+ // From https://stackoverflow.com/questions/47157428/how-to-implement-a-pseudo-blocking-async-queue-in-js-ts
2
+
3
+ // const jobQueue = [];
4
+ export default class {
5
+ constructor() {
6
+ // invariant: at least one of the arrays is empty
7
+ this.resolvers = [];
8
+ this.promises = [];
9
+ }
10
+ _add() {
11
+ this.promises.push(
12
+ new Promise(resolve => {
13
+ this.resolvers.push(resolve);
14
+ })
15
+ );
16
+ }
17
+ enqueue(t) {
18
+ // if (this.resolvers.length) this.resolvers.shift()(t);
19
+ // else this.promises.push(Promise.resolve(t));
20
+ if (!this.resolvers.length) this._add();
21
+ this.resolvers.shift()(t);
22
+ }
23
+ dequeue() {
24
+ if (!this.promises.length) this._add();
25
+ return this.promises.shift();
26
+ }
27
+ // now some utilities:
28
+ isEmpty() {
29
+ // there are no values available
30
+ return !this.promises.length; // this.length <= 0
31
+ }
32
+ isBlocked() {
33
+ // it's waiting for values
34
+ return !!this.resolvers.length; // this.length < 0
35
+ }
36
+ get length() {
37
+ return this.promises.length - this.resolvers.length;
38
+ }
39
+ sleep(ms) {
40
+ return new Promise(resolve => setTimeout(resolve, ms));
41
+ }
42
+ async start() {
43
+ // TODO: This is experimental
44
+ const delayBetweenJobs = 2000;
45
+
46
+ for await (const job of this) {
47
+ console.log("Executing job...");
48
+ job();
49
+ if (delayBetweenJobs) {
50
+ console.log("Waiting for next job1...");
51
+ await this.sleep(delayBetweenJobs);
52
+ console.log("Waiting for next job2...");
53
+ }
54
+ }
55
+ // console.log("JOB1");
56
+ // const job = this.dequeue();
57
+ // console.log("JOB2", job);
58
+ // job();
59
+ // Vue.nextTick(() => {
60
+ // this.start();
61
+ // });
62
+ // await this.next();
63
+ }
64
+ [Symbol.asyncIterator]() {
65
+ // Todo: Use AsyncIterator.from()
66
+ return {
67
+ next: () => this.dequeue().then(value => ({ done: false, value })),
68
+ [Symbol.asyncIterator]() {
69
+ return this;
70
+ }
71
+ };
72
+ }
73
+ }
74
+
75
+ // export default class {
76
+ // constructor() {
77
+ // this.jobQueue = [];
78
+ // this.timerHandle = null;
79
+ // }
80
+ // // static get csrfElement() {
81
+ // // return document.querySelector(`meta[name="csrf-token"]`);
82
+ // // }
83
+
84
+ // // static getCsrf() {
85
+ // // return this.csrfElement.getAttribute("content");
86
+ // // }
87
+
88
+ // // static setCsrf(value) {
89
+ // // return this.csrfElement.setAttribute("content", value);
90
+ // // }
91
+
92
+ // start(interval) {
93
+ // this.timerHandle = setInterval(() => {
94
+ // console.log("DEQUQE1");
95
+ // const oldestJob = this.jobQueue.shift();
96
+ // if (oldestJob) {
97
+ // console.log("DEQUQE2");
98
+ // oldestJob();
99
+ // }
100
+ // }, interval);
101
+ // }
102
+
103
+ // stop() {
104
+ // clearInterval(this.timerHandle);
105
+ // }
106
+
107
+ // enqueue(job) {
108
+ // this.jobQueue.push(job);
109
+ // }
110
+ // }
package/utils/settings.js CHANGED
@@ -1,3 +1,5 @@
1
+ import config from '../package.json';
2
+
1
3
  class MutableSettings {
2
4
  constructor() {
3
5
  this.reactive = true;
@@ -22,7 +24,7 @@ export default class ImmutableSettings {
22
24
  }
23
25
 
24
26
  static get appVersion() {
25
- return require("../package.json").version;
27
+ return config.version;
26
28
  }
27
29
 
28
30
  // static get build() {
package/utils/type.js CHANGED
File without changes
package/utils/uploader.js CHANGED
File without changes