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.
- package/.eslintrc.js +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/action.js +6 -1
- package/actions/analytics/logEvent.js +0 -0
- package/actions/auth/creditCard.js +0 -0
- package/actions/auth/restart.js +0 -0
- package/actions/auth/saveCsrfToken.js +0 -0
- package/actions/cables/push.js +0 -0
- package/actions/commands/copy.js +0 -0
- package/actions/commands/enqueue.js +17 -0
- package/actions/components/update.js +13 -14
- package/actions/dialogs/alert.js +0 -0
- package/actions/dialogs/close.js +0 -0
- package/actions/dialogs/notification.js +0 -0
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/open.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/actions/dialogs/reload.js +0 -0
- package/actions/dialogs/show.js +0 -0
- package/actions/http/delete.js +0 -0
- package/actions/http/patch.js +0 -0
- package/actions/http/post.js +0 -0
- package/actions/http/put.js +0 -0
- package/actions/panels/scrollTo.js +0 -0
- package/actions/panels/scrollToBottom.js +0 -0
- package/actions/runMultiple.js +0 -0
- package/actions/sheets/select.js +0 -0
- package/actions/snackbars/alert.js +0 -0
- package/actions/snackbars/select.js +0 -0
- package/actions/timeouts/set.js +0 -0
- package/actions/tours/start.js +0 -0
- package/actions/windows/close.js +0 -0
- package/actions/windows/closeAll.js +0 -0
- package/actions/windows/closeWithReload.js +0 -0
- package/actions/windows/open.js +0 -0
- package/actions/windows/openWeb.js +0 -0
- package/actions/windows/print.js +0 -0
- package/actions/windows/refreshState.js +0 -0
- package/actions/windows/reload.js +0 -0
- package/actions/ws/push.js +0 -0
- package/app.vue +25 -26
- package/components/_button.vue +21 -28
- package/components/_chip.vue +14 -19
- package/components/_dropdownMenu.vue +10 -23
- package/components/_icon.vue +5 -5
- package/components/_message.vue +0 -0
- package/components/_responsive.vue +7 -21
- package/components/avatar.vue +11 -15
- package/components/banners/alert.vue +2 -7
- package/components/banners/select.vue +18 -30
- package/components/button.vue +5 -5
- package/components/calendar.vue +0 -0
- package/components/component.vue +96 -101
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/_patternText.vue +5 -19
- package/components/fields/_select.vue +7 -28
- package/components/fields/autocomplete.vue +5 -21
- package/components/fields/check.vue +19 -11
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/field.vue +9 -27
- package/components/fields/country/regions.js +0 -0
- package/components/fields/creditCard.vue +0 -0
- package/components/fields/date.vue +5 -5
- package/components/fields/datetime.vue +5 -5
- package/components/fields/dynamicSelect.vue +8 -29
- package/components/fields/file.vue +0 -0
- package/components/fields/googlePlace.vue +0 -0
- package/components/fields/hidden.vue +0 -0
- package/components/fields/location.vue +0 -0
- package/components/fields/newRichText.vue +66 -53
- package/components/fields/otpField.vue +6 -14
- package/components/fields/phone/countries.js +0 -0
- package/components/fields/phone/field.vue +60 -78
- package/components/fields/phone/sprite.css +0 -0
- package/components/fields/radio.vue +16 -23
- package/components/fields/rating.vue +9 -16
- package/components/fields/richText.vue +8 -28
- package/components/fields/select.vue +10 -7
- package/components/fields/stripe/stripeFields.vue +0 -0
- package/components/fields/stripe/stripeIndividualFields.vue +0 -0
- package/components/fields/stripeExternalAccount.vue +10 -24
- package/components/fields/stripeToken.vue +0 -0
- package/components/fields/submit.vue +0 -0
- package/components/fields/text.vue +24 -40
- package/components/fields/textarea.vue +13 -27
- package/components/fields/timeZone.vue +9 -6
- package/components/fields/timer.vue +3 -10
- package/components/h1.vue +0 -0
- package/components/h2.vue +0 -0
- package/components/h3.vue +0 -0
- package/components/h5.vue +0 -0
- package/components/h6.vue +0 -0
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/icon.vue +0 -0
- package/components/image.vue +13 -20
- package/components/label.vue +0 -0
- package/components/markdown.vue +15 -8
- package/components/mixins/chart/annotation.js +0 -0
- package/components/mixins/chart/tooltip.js +0 -0
- package/components/mixins/dataset.js +0 -0
- package/components/mixins/events.js +17 -6
- package/components/mixins/extension.js +0 -0
- package/components/mixins/list/autoload.js +0 -0
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/styles.js +18 -15
- package/components/mixins/table/autoload.js +0 -0
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/mixins/text.js +0 -0
- package/components/mixins/ws/actionCable.js +0 -0
- package/components/mixins/ws/phoenixSocket.js +0 -0
- package/components/multimedia/video.vue +0 -0
- package/components/p.vue +0 -0
- package/components/panels/carousel.vue +0 -0
- package/components/panels/column.vue +5 -5
- package/components/panels/custom.vue +15 -15
- package/components/panels/flow.vue +19 -13
- package/components/panels/form.vue +17 -28
- package/components/panels/grid.vue +15 -9
- package/components/panels/horizontal.vue +149 -18
- package/components/panels/list.vue +63 -70
- package/components/panels/responsive.vue +13 -33
- package/components/panels/scroll.vue +0 -0
- package/components/panels/split.vue +2 -2
- package/components/panels/table.vue +27 -61
- package/components/panels/timeline.vue +20 -30
- package/components/panels/vertical.vue +9 -14
- package/components/panels/web.vue +0 -0
- package/components/progressbar.vue +0 -0
- package/components/spacer.vue +0 -0
- package/components/switch.vue +0 -0
- package/components/tabBar.vue +27 -19
- package/index.js +68 -72
- package/keys.js +0 -0
- package/nav/appbar.vue +4 -4
- package/nav/dialog.vue +24 -34
- package/nav/drawer.vue +39 -51
- package/nav/drawerButton.vue +5 -7
- package/nav/drawerLabel.vue +2 -3
- package/nav/sheet.vue +18 -24
- package/nav/snackbar.vue +16 -26
- package/package.json +10 -11
- package/plugins/driverCustomBehavior.js +1 -1
- package/plugins/updatableComponent.js +1 -7
- package/plugins/vuetify.js +27 -0
- package/settings.json.example +0 -0
- package/static/plugins/alignment/alignment.js +0 -0
- package/static/plugins/alignment/alignment.min.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
- package/static/plugins/blockcode/blockcode.js +0 -0
- package/static/plugins/blockcode/blockcode.min.js +0 -0
- package/static/plugins/clips/clips.js +0 -0
- package/static/plugins/clips/clips.min.js +0 -0
- package/static/plugins/counter/counter.js +0 -0
- package/static/plugins/counter/counter.min.js +0 -0
- package/static/plugins/definedlinks/definedlinks.js +0 -0
- package/static/plugins/definedlinks/definedlinks.min.js +0 -0
- package/static/plugins/handle/handle.js +0 -0
- package/static/plugins/handle/handle.min.js +0 -0
- package/static/plugins/icons/icons.js +0 -0
- package/static/plugins/icons/icons.min.js +0 -0
- package/static/plugins/imageposition/imageposition.js +0 -0
- package/static/plugins/imageposition/imageposition.min.js +0 -0
- package/static/plugins/inlineformat/inlineformat.js +0 -0
- package/static/plugins/inlineformat/inlineformat.min.js +0 -0
- package/static/plugins/removeformat/removeformat.js +0 -0
- package/static/plugins/removeformat/removeformat.min.js +0 -0
- package/static/plugins/selector/selector.js +0 -0
- package/static/plugins/selector/selector.min.js +0 -0
- package/static/plugins/specialchars/specialchars.js +0 -0
- package/static/plugins/specialchars/specialchars.min.js +0 -0
- package/static/plugins/textdirection/textdirection.js +0 -0
- package/static/plugins/textdirection/textdirection.min.js +0 -0
- package/static/plugins/textexpander/textexpander.js +0 -0
- package/static/plugins/textexpander/textexpander.min.js +0 -0
- package/static/plugins/underline/underline.js +0 -0
- package/static/plugins/underline/underline.min.js +0 -0
- package/static/redactorx.css +0 -0
- package/static/redactorx.js +0 -0
- package/static/redactorx.min.css +0 -0
- package/static/redactorx.min.js +0 -0
- package/static/redactorx.usm.min.js +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/_menu.vue +0 -0
- package/templates/comment.vue +42 -19
- package/templates/featured.vue +8 -9
- package/templates/thumbnail-old.vue +188 -0
- package/templates/thumbnail.vue +5 -188
- package/templates/unsupported.vue +0 -0
- package/tsconfig.json +1 -1
- package/utils/dom.js +0 -0
- package/utils/eventBus.js +9 -2
- package/utils/helper.js +0 -0
- package/utils/history.js +7 -4
- package/utils/http.js +7 -2
- package/utils/launch.js +43 -51
- package/utils/mime_type.js +0 -0
- package/utils/private/ws.js +0 -0
- package/utils/public.js +6 -0
- package/utils/queue.js +110 -0
- package/utils/settings.js +3 -1
- package/utils/type.js +0 -0
- package/utils/uploader.js +0 -0
package/utils/launch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Vue from "
|
|
2
|
-
import Dialog from "../nav/dialog";
|
|
3
|
-
import Sheet from "../nav/sheet";
|
|
4
|
-
import Snackbar from "../nav/snackbar";
|
|
5
|
-
import
|
|
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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
themes: Utils.settings.themes
|
|
108
|
+
const instance = createApp(
|
|
109
|
+
{
|
|
110
|
+
render: function () {
|
|
111
|
+
return h(Sheet, { spec: properties })
|
|
116
112
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
Object.assign(instance._context, Vue._context)
|
|
120
116
|
|
|
121
117
|
if (component) {
|
|
122
|
-
const placeholder =
|
|
123
|
-
|
|
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
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
|
163
|
+
console.error("A Snackbar has to be displayed in a component");
|
|
172
164
|
}
|
|
173
165
|
|
|
174
166
|
return instance;
|
package/utils/mime_type.js
CHANGED
|
File without changes
|
package/utils/private/ws.js
CHANGED
|
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
|
|
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
|