zero-query 1.0.9 → 1.1.1
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/cli/commands/build-api.js +442 -0
- package/cli/commands/build.js +33 -2
- package/cli/commands/bundle.js +41 -0
- package/cli/commands/dev/server.js +56 -3
- package/cli/scaffold/default/app/components/contacts/contacts.css +9 -9
- package/cli/scaffold/default/app/components/playground/playground.css +1 -1
- package/cli/scaffold/default/app/components/playground/playground.html +5 -5
- package/cli/scaffold/default/app/components/playground/playground.js +1 -1
- package/cli/scaffold/default/app/components/toolkit/toolkit.css +1 -1
- package/cli/scaffold/default/app/components/toolkit/toolkit.html +3 -3
- package/cli/scaffold/default/app/components/toolkit/toolkit.js +4 -4
- package/cli/utils.js +6 -6
- package/dist/API.md +6603 -0
- package/dist/zquery.dist.zip +0 -0
- package/dist/zquery.js +387 -25
- package/dist/zquery.min.js +47 -17
- package/index.d.ts +9 -3
- package/index.js +10 -2
- package/package.json +2 -1
- package/src/component.js +243 -6
- package/src/reactive.js +4 -3
- package/src/router.js +79 -9
- package/src/store.js +49 -3
- package/tests/cli.test.js +80 -0
- package/tests/compare.test.js +486 -0
- package/tests/dev-server.test.js +489 -0
- package/tests/docs.test.js +1650 -0
- package/tests/electron-features.test.js +864 -0
- package/types/misc.d.ts +7 -7
- package/types/reactive.d.ts +1 -1
- package/types/store.d.ts +2 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to the contacts-page component by zQuery.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/*
|
|
7
|
+
/* -- Toolbar -- */
|
|
8
8
|
.ct-bar {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
/*
|
|
78
|
+
/* -- Filter chips -- */
|
|
79
79
|
.ct-chips {
|
|
80
80
|
display: flex;
|
|
81
81
|
gap: 0.35rem;
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
font-weight: 600;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/*
|
|
111
|
+
/* -- Buttons -- */
|
|
112
112
|
.ct-btn {
|
|
113
113
|
display: inline-flex;
|
|
114
114
|
align-items: center;
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
font-size: 0.78rem;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/*
|
|
169
|
+
/* -- Contact Grid -- */
|
|
170
170
|
.ct-grid {
|
|
171
171
|
display: grid;
|
|
172
172
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
opacity: 1;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
/*
|
|
317
|
+
/* -- Empty -- */
|
|
318
318
|
.ct-empty-card {
|
|
319
319
|
text-align: center;
|
|
320
320
|
padding: 3rem 1rem;
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
color: #fff;
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
/*
|
|
408
|
+
/* -- Add-contact modal heading -- */
|
|
409
409
|
.ct-modal-heading {
|
|
410
410
|
padding: 1.25rem 1.5rem 0;
|
|
411
411
|
}
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
color: var(--text-muted);
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
/*
|
|
424
|
+
/* -- Form inside modal -- */
|
|
425
425
|
.ct-form {
|
|
426
426
|
display: flex;
|
|
427
427
|
flex-direction: column;
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
padding-top: 0.35rem;
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
/*
|
|
491
|
+
/* -- Detail modal: profile -- */
|
|
492
492
|
.ct-modal-profile {
|
|
493
493
|
display: flex;
|
|
494
494
|
flex-direction: column;
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
font-weight: 500;
|
|
609
609
|
}
|
|
610
610
|
|
|
611
|
-
/*
|
|
611
|
+
/* -- Responsive -- */
|
|
612
612
|
@media (max-width: 768px) {
|
|
613
613
|
.ct-bar {
|
|
614
614
|
flex-direction: column;
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
.pg-vpill:hover { border-color: var(--accent); color: var(--text); }
|
|
103
103
|
.pg-vpill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
|
|
104
104
|
|
|
105
|
-
/*
|
|
105
|
+
/* -- Responsive -- */
|
|
106
106
|
@media (max-width: 768px) {
|
|
107
107
|
.pg-variant-box { min-width: 0; flex: 1 1 100%; }
|
|
108
108
|
.pg-variant-row { flex-direction: column; }
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<p class="subtitle">Interactive UI patterns - event modifiers, animations, reactive bindings, and plugins.</p>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
<!--
|
|
12
|
+
<!-- -- Interaction Patterns ---------------------------- -->
|
|
13
13
|
<div class="pg-section">Interaction Patterns</div>
|
|
14
14
|
|
|
15
15
|
<div class="card" style="position:relative;z-index:2;">
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
<!--
|
|
47
|
+
<!-- -- Animations ------------------------------------ -->
|
|
48
48
|
<div class="pg-section">Animations</div>
|
|
49
49
|
|
|
50
50
|
<div class="card">
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
|
|
84
|
-
<!--
|
|
84
|
+
<!-- -- Reactive Bindings ----------------------------- -->
|
|
85
85
|
<div class="pg-section">Reactive Bindings</div>
|
|
86
86
|
|
|
87
87
|
<div class="card-grid">
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
</div>
|
|
124
124
|
</div>
|
|
125
125
|
|
|
126
|
-
<!--
|
|
126
|
+
<!-- -- Keyboard ------------------------------------ -->
|
|
127
127
|
<div class="pg-section">Keyboard</div>
|
|
128
128
|
|
|
129
129
|
<div class="card">
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
</div>
|
|
141
141
|
</div>
|
|
142
142
|
|
|
143
|
-
<!--
|
|
143
|
+
<!-- -- Plugin System --------------------------------- -->
|
|
144
144
|
<div class="pg-section">Plugin System</div>
|
|
145
145
|
|
|
146
146
|
<div class="card">
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// z-skip - morph opt-out
|
|
11
11
|
// templateUrl / styleUrl - external files
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// -- $.fn Plugins -------------------------------------------------
|
|
14
14
|
$.fn.highlight = function (color = 'var(--accent)') {
|
|
15
15
|
this.css({ boxShadow: `0 0 0 3px ${color}`, transition: 'box-shadow .3s ease' });
|
|
16
16
|
const self = this;
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
border: 1px solid rgba(88,166,255,.1); }
|
|
88
88
|
.tk-stat-val { font-weight: 700; color: var(--accent); }
|
|
89
89
|
|
|
90
|
-
/*
|
|
90
|
+
/* -- Responsive: tabs -- */
|
|
91
91
|
@media (max-width: 768px) {
|
|
92
92
|
.tk-tabs { flex-wrap: wrap; }
|
|
93
93
|
.tk-tab { flex: 1 1 auto; min-width: 0; padding: .5rem .6rem; font-size: .8rem; }
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<button class="tk-tab {{activeTab === 'store' ? 'active' : ''}}" @click="setTab('store')">◈ Store</button>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
<!--
|
|
19
|
+
<!-- -- HTTP Tab ------------------------------------- -->
|
|
20
20
|
<div z-if="activeTab === 'http'">
|
|
21
21
|
<div class="card">
|
|
22
22
|
<h3>CRUD Operations</h3>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
|
-
<!--
|
|
64
|
+
<!-- -- Utilities Tab -------------------------------- -->
|
|
65
65
|
<div z-else-if="activeTab === 'utils'">
|
|
66
66
|
<div class="card">
|
|
67
67
|
<h3>Utility Belt</h3>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
101
|
-
<!--
|
|
101
|
+
<!-- -- Store Tab ------------------------------------ -->
|
|
102
102
|
<div z-else>
|
|
103
103
|
<div class="card" style="margin-bottom:.75rem;">
|
|
104
104
|
<h3>Store Inspector</h3>
|
|
@@ -105,7 +105,7 @@ $.component('toolkit-page', {
|
|
|
105
105
|
this.state.storeHistory = null;
|
|
106
106
|
},
|
|
107
107
|
|
|
108
|
-
/*
|
|
108
|
+
/* -- HTTP demos --------------------------------------------- */
|
|
109
109
|
|
|
110
110
|
async doGet() {
|
|
111
111
|
this._updateHttpMeta('GET', '/posts/1');
|
|
@@ -165,7 +165,7 @@ $.component('toolkit-page', {
|
|
|
165
165
|
} finally { this.state.searchLoading = false; }
|
|
166
166
|
},
|
|
167
167
|
|
|
168
|
-
/*
|
|
168
|
+
/* -- Utility demos ------------------------------------------- */
|
|
169
169
|
|
|
170
170
|
runUtil(name) {
|
|
171
171
|
this.state.activeUtil = name;
|
|
@@ -197,7 +197,7 @@ $.component('toolkit-page', {
|
|
|
197
197
|
`$.memoize(fibonacci)`,
|
|
198
198
|
``,
|
|
199
199
|
`fib(35) = ${result}`,
|
|
200
|
-
|
|
200
|
+
`----------------------------`,
|
|
201
201
|
`No memoize: ${slowTime.toFixed(1)} ms`,
|
|
202
202
|
`Memoized: ${fastTime.toFixed(3)} ms`,
|
|
203
203
|
`Cached: ${cachedTime.toFixed(4)} ms ⚡`,
|
|
@@ -264,7 +264,7 @@ $.component('toolkit-page', {
|
|
|
264
264
|
this.state.utilOutput = result;
|
|
265
265
|
},
|
|
266
266
|
|
|
267
|
-
/*
|
|
267
|
+
/* -- Store demos -------------------------------------------- */
|
|
268
268
|
|
|
269
269
|
takeSnapshot() {
|
|
270
270
|
this.state.storeSnap = JSON.stringify($.getStore('main').snapshot(), null, 2);
|
package/cli/utils.js
CHANGED
|
@@ -149,7 +149,7 @@ function _minifyBody(code) {
|
|
|
149
149
|
const ch = code[i];
|
|
150
150
|
const nx = code[i + 1];
|
|
151
151
|
|
|
152
|
-
//
|
|
152
|
+
// -- Regular string literal: copy verbatim -----------------
|
|
153
153
|
if (ch === '"' || ch === "'") {
|
|
154
154
|
const q = ch;
|
|
155
155
|
out += ch; i++;
|
|
@@ -162,14 +162,14 @@ function _minifyBody(code) {
|
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
//
|
|
165
|
+
// -- Template literal: copy verbatim with ${…} nesting -------
|
|
166
166
|
if (ch === '`') {
|
|
167
167
|
const tpl = _copyTemplateLiteral(code, i);
|
|
168
168
|
out += tpl.text; i = tpl.end;
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
//
|
|
172
|
+
// -- Block comment: skip -------------------------------------
|
|
173
173
|
if (ch === '/' && nx === '*') {
|
|
174
174
|
i += 2;
|
|
175
175
|
while (i < code.length && !(code[i] === '*' && code[i + 1] === '/')) i++;
|
|
@@ -177,14 +177,14 @@ function _minifyBody(code) {
|
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
//
|
|
180
|
+
// -- Line comment: skip --------------------------------------
|
|
181
181
|
if (ch === '/' && nx === '/') {
|
|
182
182
|
i += 2;
|
|
183
183
|
while (i < code.length && code[i] !== '\n') i++;
|
|
184
184
|
continue;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
//
|
|
187
|
+
// -- Regex literal: copy verbatim ----------------------------
|
|
188
188
|
if (ch === '/') {
|
|
189
189
|
if (_isRegexCtx(out)) {
|
|
190
190
|
out += ch; i++;
|
|
@@ -204,7 +204,7 @@ function _minifyBody(code) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
//
|
|
207
|
+
// -- Whitespace: collapse ------------------------------------
|
|
208
208
|
if (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
|
|
209
209
|
let hasNewline = ch === '\n' || ch === '\r';
|
|
210
210
|
while (i < code.length && (code[i] === ' ' || code[i] === '\t' || code[i] === '\n' || code[i] === '\r')) {
|