mol_jsx_lib 0.0.61 → 0.0.64
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/node.d.ts +14 -16
- package/node.deps.json +1 -1
- package/node.esm.js +55 -60
- package/node.esm.js.map +1 -1
- package/node.js +55 -60
- package/node.js.map +1 -1
- package/node.test.js +104 -109
- package/node.test.js.map +1 -1
- package/package.json +5 -5
- package/web.d.ts +14 -16
- package/web.deps.json +1 -1
- package/web.esm.js +55 -60
- package/web.esm.js.map +1 -1
- package/web.js +55 -60
- package/web.js.map +1 -1
- package/web.test.js +49 -49
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -828,7 +828,7 @@ var $;
|
|
|
828
828
|
function $mol_jsx(Elem, props, ...childNodes) {
|
|
829
829
|
const id = props && props.id || '';
|
|
830
830
|
const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
|
|
831
|
-
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id}`) : $.$mol_jsx_crumbs;
|
|
831
|
+
const crumbs_self = id ? $.$mol_jsx_crumbs.replace(/(\S+)/g, `$1_${id.replace(/\/.*/i, '')}`) : $.$mol_jsx_crumbs;
|
|
832
832
|
if (Elem && $.$mol_jsx_booked) {
|
|
833
833
|
if ($.$mol_jsx_booked.has(id)) {
|
|
834
834
|
$mol_fail(new Error(`JSX already has tag with id ${JSON.stringify(guid)}`));
|
|
@@ -904,7 +904,11 @@ var $;
|
|
|
904
904
|
$mol_dom_render_children(node, [].concat(...childNodes));
|
|
905
905
|
if (!Elem)
|
|
906
906
|
return node;
|
|
907
|
+
if (guid)
|
|
908
|
+
node.id = guid;
|
|
907
909
|
for (const key in props) {
|
|
910
|
+
if (key === 'id')
|
|
911
|
+
continue;
|
|
908
912
|
if (typeof props[key] === 'string') {
|
|
909
913
|
;
|
|
910
914
|
node.setAttribute(key, props[key]);
|
|
@@ -921,8 +925,6 @@ var $;
|
|
|
921
925
|
node[key] = props[key];
|
|
922
926
|
}
|
|
923
927
|
}
|
|
924
|
-
if (guid)
|
|
925
|
-
node.id = guid;
|
|
926
928
|
if ($.$mol_jsx_crumbs)
|
|
927
929
|
node.className = (props?.['class'] ? props['class'] + ' ' : '') + crumbs_self;
|
|
928
930
|
return node;
|
|
@@ -1042,6 +1044,19 @@ var $;
|
|
|
1042
1044
|
;
|
|
1043
1045
|
"use strict";
|
|
1044
1046
|
var $;
|
|
1047
|
+
(function ($) {
|
|
1048
|
+
function $mol_const(value) {
|
|
1049
|
+
var getter = (() => value);
|
|
1050
|
+
getter['()'] = value;
|
|
1051
|
+
getter[Symbol.toStringTag] = value;
|
|
1052
|
+
return getter;
|
|
1053
|
+
}
|
|
1054
|
+
$.$mol_const = $mol_const;
|
|
1055
|
+
})($ || ($ = {}));
|
|
1056
|
+
//mol/const/const.ts
|
|
1057
|
+
;
|
|
1058
|
+
"use strict";
|
|
1059
|
+
var $;
|
|
1045
1060
|
(function ($) {
|
|
1046
1061
|
$['devtoolsFormatters'] = $['devtoolsFormatters'] || [];
|
|
1047
1062
|
function $mol_dev_format_register(config) {
|
|
@@ -1870,6 +1885,40 @@ var $;
|
|
|
1870
1885
|
;
|
|
1871
1886
|
"use strict";
|
|
1872
1887
|
var $;
|
|
1888
|
+
(function ($) {
|
|
1889
|
+
function $mol_wire_field(host, field, descr) {
|
|
1890
|
+
if (!descr)
|
|
1891
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1892
|
+
const _get = descr?.get || $mol_const(descr?.value);
|
|
1893
|
+
const persist = $mol_wire_atom.getter(_get, 0);
|
|
1894
|
+
const _set = descr?.set || function (next) {
|
|
1895
|
+
persist(this, []).put(next);
|
|
1896
|
+
};
|
|
1897
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1898
|
+
const sup_descr = Reflect.getOwnPropertyDescriptor(sup, field);
|
|
1899
|
+
Object.defineProperty(_get, 'name', { value: sup_descr?.get?.name ?? field });
|
|
1900
|
+
Object.defineProperty(_set, 'name', { value: sup_descr?.set?.name ?? field });
|
|
1901
|
+
function get() {
|
|
1902
|
+
return persist(this, []).sync();
|
|
1903
|
+
}
|
|
1904
|
+
const temp = $mol_wire_task.getter(_set);
|
|
1905
|
+
function set(next) {
|
|
1906
|
+
temp(this, [next]).sync();
|
|
1907
|
+
}
|
|
1908
|
+
Object.defineProperty(get, 'name', { value: _get.name + '$' });
|
|
1909
|
+
Object.defineProperty(set, 'name', { value: _set.name + '@' });
|
|
1910
|
+
Object.assign(get, { orig: _get });
|
|
1911
|
+
Object.assign(set, { orig: _set });
|
|
1912
|
+
const { value, writable, ...descr2 } = { ...descr, get, set };
|
|
1913
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1914
|
+
return descr2;
|
|
1915
|
+
}
|
|
1916
|
+
$.$mol_wire_field = $mol_wire_field;
|
|
1917
|
+
})($ || ($ = {}));
|
|
1918
|
+
//mol/wire/field/field.ts
|
|
1919
|
+
;
|
|
1920
|
+
"use strict";
|
|
1921
|
+
var $;
|
|
1873
1922
|
(function ($) {
|
|
1874
1923
|
function $mol_wire_mem(keys) {
|
|
1875
1924
|
const wrap = $mol_wire_mem_func(keys);
|
|
@@ -1937,12 +1986,8 @@ var $;
|
|
|
1937
1986
|
ownerDocument;
|
|
1938
1987
|
className;
|
|
1939
1988
|
get childNodes() {
|
|
1940
|
-
return
|
|
1941
|
-
}
|
|
1942
|
-
set childNodes(next) {
|
|
1943
|
-
this._kids(next);
|
|
1989
|
+
return [];
|
|
1944
1990
|
}
|
|
1945
|
-
_kids(next = []) { return next; }
|
|
1946
1991
|
valueOf() {
|
|
1947
1992
|
const prefix = $mol_jsx_prefix;
|
|
1948
1993
|
const booked = $mol_jsx_booked;
|
|
@@ -1962,13 +2007,10 @@ var $;
|
|
|
1962
2007
|
$mol_jsx_document = document;
|
|
1963
2008
|
}
|
|
1964
2009
|
}
|
|
1965
|
-
render() {
|
|
1966
|
-
return $mol_fail(new Error(`render() isn't implemented`));
|
|
1967
|
-
}
|
|
1968
2010
|
}
|
|
1969
2011
|
__decorate([
|
|
1970
|
-
$
|
|
1971
|
-
], $mol_jsx_view.prototype, "
|
|
2012
|
+
$mol_wire_field
|
|
2013
|
+
], $mol_jsx_view.prototype, "childNodes", null);
|
|
1972
2014
|
__decorate([
|
|
1973
2015
|
$mol_mem
|
|
1974
2016
|
], $mol_jsx_view.prototype, "valueOf", null);
|
|
@@ -2078,53 +2120,6 @@ var $;
|
|
|
2078
2120
|
;
|
|
2079
2121
|
"use strict";
|
|
2080
2122
|
var $;
|
|
2081
|
-
(function ($) {
|
|
2082
|
-
function $mol_const(value) {
|
|
2083
|
-
var getter = (() => value);
|
|
2084
|
-
getter['()'] = value;
|
|
2085
|
-
getter[Symbol.toStringTag] = value;
|
|
2086
|
-
return getter;
|
|
2087
|
-
}
|
|
2088
|
-
$.$mol_const = $mol_const;
|
|
2089
|
-
})($ || ($ = {}));
|
|
2090
|
-
//mol/const/const.ts
|
|
2091
|
-
;
|
|
2092
|
-
"use strict";
|
|
2093
|
-
var $;
|
|
2094
|
-
(function ($) {
|
|
2095
|
-
function $mol_wire_field(host, field, descr) {
|
|
2096
|
-
if (!descr)
|
|
2097
|
-
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
2098
|
-
const _get = descr?.get || $mol_const(descr?.value);
|
|
2099
|
-
const persist = $mol_wire_atom.getter(_get, 0);
|
|
2100
|
-
const _set = descr?.set || function (next) {
|
|
2101
|
-
persist(this, []).put(next);
|
|
2102
|
-
};
|
|
2103
|
-
const sup = Reflect.getPrototypeOf(host);
|
|
2104
|
-
const sup_descr = Reflect.getOwnPropertyDescriptor(sup, field);
|
|
2105
|
-
Object.defineProperty(_get, 'name', { value: sup_descr?.get?.name ?? field });
|
|
2106
|
-
Object.defineProperty(_set, 'name', { value: sup_descr?.set?.name ?? field });
|
|
2107
|
-
function get() {
|
|
2108
|
-
return persist(this, []).sync();
|
|
2109
|
-
}
|
|
2110
|
-
const temp = $mol_wire_task.getter(_set);
|
|
2111
|
-
function set(next) {
|
|
2112
|
-
temp(this, [next]).sync();
|
|
2113
|
-
}
|
|
2114
|
-
Object.defineProperty(get, 'name', { value: _get.name + '$' });
|
|
2115
|
-
Object.defineProperty(set, 'name', { value: _set.name + '@' });
|
|
2116
|
-
Object.assign(get, { orig: _get });
|
|
2117
|
-
Object.assign(set, { orig: _set });
|
|
2118
|
-
const { value, writable, ...descr2 } = { ...descr, get, set };
|
|
2119
|
-
Reflect.defineProperty(host, field, descr2);
|
|
2120
|
-
return descr2;
|
|
2121
|
-
}
|
|
2122
|
-
$.$mol_wire_field = $mol_wire_field;
|
|
2123
|
-
})($ || ($ = {}));
|
|
2124
|
-
//mol/wire/field/field.ts
|
|
2125
|
-
;
|
|
2126
|
-
"use strict";
|
|
2127
|
-
var $;
|
|
2128
2123
|
(function ($) {
|
|
2129
2124
|
function $mol_wire_patch(obj) {
|
|
2130
2125
|
for (const field of Reflect.ownKeys(obj)) {
|