@umbraco-cms/backoffice 14.0.0-bd6f74b3 → 14.0.0-c5787966
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/dist-cms/apps/app/app.element.d.ts +0 -11
- package/dist-cms/apps/app/app.element.js +2 -15
- package/dist-cms/custom-elements.json +14 -13
- package/dist-cms/external/rxjs/index.js +2 -2
- package/dist-cms/libs/element-api/element.mixin.js +0 -16
- package/dist-cms/libs/extension-api/registry/extension.registry.d.ts +1 -0
- package/dist-cms/libs/extension-api/registry/extension.registry.js +26 -18
- package/dist-cms/packages/core/localization/registry/translation.registry.js +12 -5
- package/dist-cms/packages/core/sorter/sorter.controller.js +6 -6
- package/dist-cms/packages/core/sorter/stories/test-sorter-controller.element.d.ts +13 -0
- package/dist-cms/packages/core/sorter/stories/test-sorter-controller.element.js +92 -0
- package/dist-cms/shared/lit-element/lit-element.element.d.ts +25 -0
- package/dist-cms/shared/lit-element/lit-element.element.js +42 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +6 -5
- package/package.json +1 -1
|
@@ -8,17 +8,6 @@ export declare class UmbAppElement extends UmbLitElement {
|
|
|
8
8
|
* @remarks This is the base URL of the Umbraco server, not the base URL of the backoffice.
|
|
9
9
|
*/
|
|
10
10
|
serverUrl: string;
|
|
11
|
-
/**
|
|
12
|
-
* The default culture to use for localization.
|
|
13
|
-
*
|
|
14
|
-
* When the current user is resolved, the culture will be set to the user's culture.
|
|
15
|
-
*
|
|
16
|
-
* @attr
|
|
17
|
-
* @remarks This is the default culture to use for localization, not the current culture.
|
|
18
|
-
* @example "en-us"
|
|
19
|
-
* @example "en"
|
|
20
|
-
*/
|
|
21
|
-
culture: string;
|
|
22
11
|
/**
|
|
23
12
|
* The base path of the backoffice.
|
|
24
13
|
*
|
|
@@ -29,17 +29,6 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
|
|
|
29
29
|
* @remarks This is the base URL of the Umbraco server, not the base URL of the backoffice.
|
|
30
30
|
*/
|
|
31
31
|
this.serverUrl = window.location.origin;
|
|
32
|
-
/**
|
|
33
|
-
* The default culture to use for localization.
|
|
34
|
-
*
|
|
35
|
-
* When the current user is resolved, the culture will be set to the user's culture.
|
|
36
|
-
*
|
|
37
|
-
* @attr
|
|
38
|
-
* @remarks This is the default culture to use for localization, not the current culture.
|
|
39
|
-
* @example "en-us"
|
|
40
|
-
* @example "en"
|
|
41
|
-
*/
|
|
42
|
-
this.culture = 'en-us';
|
|
43
32
|
/**
|
|
44
33
|
* The base path of the backoffice.
|
|
45
34
|
*
|
|
@@ -79,7 +68,8 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
|
|
|
79
68
|
this.#setup();
|
|
80
69
|
}
|
|
81
70
|
#setLanguage() {
|
|
82
|
-
|
|
71
|
+
const initialLanguage = this.lang || document.documentElement.lang || 'en-us';
|
|
72
|
+
umbTranslationRegistry.loadLanguage(initialLanguage);
|
|
83
73
|
}
|
|
84
74
|
#listenForLanguageChange(authContext) {
|
|
85
75
|
this.observe(authContext.languageIsoCode, (currentLanguageIsoCode) => {
|
|
@@ -247,9 +237,6 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
|
|
|
247
237
|
__decorate([
|
|
248
238
|
property({ type: String })
|
|
249
239
|
], UmbAppElement.prototype, "serverUrl", void 0);
|
|
250
|
-
__decorate([
|
|
251
|
-
property({ type: String, attribute: 'default-culture' })
|
|
252
|
-
], UmbAppElement.prototype, "culture", void 0);
|
|
253
240
|
__decorate([
|
|
254
241
|
property({ type: String })
|
|
255
242
|
// TODO: get from server config
|
|
@@ -119,12 +119,6 @@
|
|
|
119
119
|
"type": "string",
|
|
120
120
|
"default": "\"origin\""
|
|
121
121
|
},
|
|
122
|
-
{
|
|
123
|
-
"name": "default-culture",
|
|
124
|
-
"description": "The default culture to use for localization.\n\nWhen the current user is resolved, the culture will be set to the user's culture.",
|
|
125
|
-
"type": "string",
|
|
126
|
-
"default": "\"en-us\""
|
|
127
|
-
},
|
|
128
122
|
{
|
|
129
123
|
"name": "backofficePath",
|
|
130
124
|
"description": "The base path of the backoffice.",
|
|
@@ -146,13 +140,6 @@
|
|
|
146
140
|
"type": "string",
|
|
147
141
|
"default": "\"origin\""
|
|
148
142
|
},
|
|
149
|
-
{
|
|
150
|
-
"name": "culture",
|
|
151
|
-
"attribute": "default-culture",
|
|
152
|
-
"description": "The default culture to use for localization.\n\nWhen the current user is resolved, the culture will be set to the user's culture.",
|
|
153
|
-
"type": "string",
|
|
154
|
-
"default": "\"en-us\""
|
|
155
|
-
},
|
|
156
143
|
{
|
|
157
144
|
"name": "backofficePath",
|
|
158
145
|
"attribute": "backofficePath",
|
|
@@ -4020,6 +4007,20 @@
|
|
|
4020
4007
|
}
|
|
4021
4008
|
]
|
|
4022
4009
|
},
|
|
4010
|
+
{
|
|
4011
|
+
"name": "test-my-sorter-controller",
|
|
4012
|
+
"path": "./../src/packages/core/sorter/stories/test-sorter-controller.element.ts",
|
|
4013
|
+
"properties": [
|
|
4014
|
+
{
|
|
4015
|
+
"name": "styles",
|
|
4016
|
+
"type": "array",
|
|
4017
|
+
"default": "[null]"
|
|
4018
|
+
},
|
|
4019
|
+
{
|
|
4020
|
+
"name": "sorter"
|
|
4021
|
+
}
|
|
4022
|
+
]
|
|
4023
|
+
},
|
|
4023
4024
|
{
|
|
4024
4025
|
"name": "umb-entity-tree-item",
|
|
4025
4026
|
"path": "./../src/packages/core/tree/entity-tree-item/entity-tree-item.element.ts",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var M=function(t,r){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},M(t,r)};function m(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");M(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function At(t,r,e,n){function i(o){return o instanceof e?o:new e(function(u){u(o)})}return new(e||(e=Promise))(function(o,u){function c(f){try{
|
|
1
|
+
var M=function(t,r){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},M(t,r)};function m(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");M(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function At(t,r,e,n){function i(o){return o instanceof e?o:new e(function(u){u(o)})}return new(e||(e=Promise))(function(o,u){function c(f){try{a(n.next(f))}catch(h){u(h)}}function s(f){try{a(n.throw(f))}catch(h){u(h)}}function a(f){f.done?o(f.value):i(f.value).then(c,s)}a((n=n.apply(t,r||[])).next())})}function Q(t,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(a){return function(f){return s([a,f])}}function s(a){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(e=0)),e;)try{if(n=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1],o=a;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(a);break}o[2]&&e.ops.pop(),e.trys.pop();continue}a=r.call(t,e)}catch(f){a=[6,f],i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function x(t){var r=typeof Symbol=="function"&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(t,r){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var n=e.call(t),i,o=[],u;try{for(;(r===void 0||r-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(c){u={error:c}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(u)throw u.error}}return o}function I(t,r,e){if(e||arguments.length===2)for(var n=0,i=r.length,o;n<i;n++)(o||!(n in r))&&(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return t.concat(o||Array.prototype.slice.call(r))}function A(t){return this instanceof A?(this.v=t,this):new A(t)}function Ot(t,r,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(t,r||[]),i,o=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(l){n[l]&&(i[l]=function(d){return new Promise(function(b,p){o.push([l,d,b,p])>1||c(l,d)})})}function c(l,d){try{s(n[l](d))}catch(b){h(o[0][3],b)}}function s(l){l.value instanceof A?Promise.resolve(l.value.v).then(a,f):h(o[0][2],l)}function a(l){c("next",l)}function f(l){c("throw",l)}function h(l,d){l(d),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Pt(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],e;return r?r.call(t):(t=typeof x=="function"?x(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(o){e[o]=t[o]&&function(u){return new Promise(function(c,s){u=t[o](u),i(c,s,u.done,u.value)})}}function i(o,u,c,s){Promise.resolve(s).then(function(a){o({value:a,done:c})},u)}}typeof SuppressedError=="function"&&SuppressedError;function v(t){return typeof t=="function"}function Y(t){var r=function(n){Error.call(n),n.stack=new Error().stack},e=t(r);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var q=Y(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
2
2
|
`+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function F(t,r){if(t){var e=t.indexOf(r);0<=e&&t.splice(e,1)}}var O=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,e,n,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=x(u),a=c.next();!a.done;a=c.next()){var s=a.value;s.remove(this)}}catch(p){r={error:p}}finally{try{a&&!a.done&&(e=c.return)&&e.call(c)}finally{if(r)throw r.error}}else u.remove(this);var f=this.initialTeardown;if(v(f))try{f()}catch(p){o=p instanceof q?p.errors:[p]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=x(h),d=l.next();!d.done;d=l.next()){var b=d.value;try{N(b)}catch(p){o=o??[],p instanceof q?o=I(I([],E(o)),E(p.errors)):o.push(p)}}}catch(p){n={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}if(o)throw new q(o)}},t.prototype.add=function(r){var e;if(r&&r!==this)if(this.closed)N(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(r)}},t.prototype._hasParent=function(r){var e=this._parentage;return e===r||Array.isArray(e)&&e.includes(r)},t.prototype._addParent=function(r){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(r),e):e?[e,r]:r},t.prototype._removeParent=function(r){var e=this._parentage;e===r?this._parentage=null:Array.isArray(e)&&F(e,r)},t.prototype.remove=function(r){var e=this._finalizers;e&&F(e,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),X=O.EMPTY;function z(t){return t instanceof O||t&&"closed"in t&&v(t.remove)&&v(t.add)&&v(t.unsubscribe)}function N(t){v(t)?t():t.unsubscribe()}var tt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Tt={setTimeout:function(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,I([t,r],E(e)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function et(t){Tt.setTimeout(function(){throw t})}function D(){}function V(t){t()}var G=function(t){m(r,t);function r(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,z(e)&&e.add(n)):n.destination=Rt,n}return r.create=function(e,n,i){return new P(e,n,i)},r.prototype.next=function(e){this.isStopped||this._next(e)},r.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(O),jt=Function.prototype.bind;function K(t,r){return jt.call(t,r)}var Ct=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var e=this.partialObserver;if(e.next)try{e.next(r)}catch(n){L(n)}},t.prototype.error=function(r){var e=this.partialObserver;if(e.error)try{e.error(r)}catch(n){L(n)}else L(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(e){L(e)}},t}(),P=function(t){m(r,t);function r(e,n,i){var o=t.call(this)||this,u;if(v(e)||!e)u={next:e??void 0,error:n??void 0,complete:i??void 0};else{var c;o&&tt.useDeprecatedNextContext?(c=Object.create(e),c.unsubscribe=function(){return o.unsubscribe()},u={next:e.next&&K(e.next,c),error:e.error&&K(e.error,c),complete:e.complete&&K(e.complete,c)}):u=e}return o.destination=new Ct(u),o}return r}(G);function L(t){et(t)}function kt(t){throw t}var Rt={closed:!0,next:D,error:kt,complete:D},Z=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function j(t){return t}function Ut(t){return t.length===0?j:t.length===1?t[0]:function(e){return t.reduce(function(n,i){return i(n)},e)}}var y=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var e=new t;return e.source=this,e.operator=r,e},t.prototype.subscribe=function(r,e,n){var i=this,o=Vt(r)?r:new P(r,e,n);return V(function(){var u=i,c=u.operator,a=u.source;o.add(c?c.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(e){r.error(e)}},t.prototype.forEach=function(r,e){var n=this;return e=rt(e),new e(function(i,o){var u=new P({next:function(c){try{r(c)}catch(a){o(a),u.unsubscribe()}},error:o,complete:i});n.subscribe(u)})},t.prototype._subscribe=function(r){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(r)},t.prototype[Z]=function(){return this},t.prototype.pipe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Ut(r)(this)},t.prototype.toPromise=function(r){var e=this;return r=rt(r),new r(function(n,i){var o;e.subscribe(function(u){return o=u},function(u){return i(u)},function(){return n(o)})})},t.create=function(r){return new t(r)},t}();function rt(t){var r;return(r=t??tt.Promise)!==null&&r!==void 0?r:Promise}function Ft(t){return t&&v(t.next)&&v(t.error)&&v(t.complete)}function Vt(t){return t&&t instanceof G||Ft(t)&&z(t)}function Lt(t){return v(t?.lift)}function w(t){return function(r){if(Lt(r))return r.lift(function(e){try{return t(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function S(t,r,e,n,i){return new Wt(t,r,e,n,i)}var Wt=function(t){m(r,t);function r(e,n,i,o,u,c){var a=t.call(this,e)||this;return a.onFinalize=u,a.shouldUnsubscribe=c,a._next=n?function(s){try{n(s)}catch(f){e.error(f)}}:t.prototype._next,a._error=o?function(s){try{o(s)}catch(f){e.error(f)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=i?function(){try{i()}catch(s){e.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,a}return r.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},r}(G),Mt=Y(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),C=function(t){m(r,t);function r(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.prototype.lift=function(e){var n=new nt(this,this);return n.operator=e,n},r.prototype._throwIfClosed=function(){if(this.closed)throw new Mt},r.prototype.next=function(e){var n=this;V(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var u=x(n.currentObservers),c=u.next();!c.done;c=u.next()){var a=c.value;a.next(e)}}catch(s){i={error:s}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}})},r.prototype.error=function(e){var n=this;V(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},r.prototype.complete=function(){var e=this;V(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},r.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},r.prototype._innerSubscribe=function(e){var n=this,i=this,o=i.hasError,u=i.isStopped,c=i.observers;return o||u?X:(this.currentObservers=null,c.push(e),new O(function(){n.currentObservers=null,F(c,e)}))},r.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,o=n.thrownError,u=n.isStopped;i?e.error(o):u&&e.complete()},r.prototype.asObservable=function(){var e=new y;return e.source=this,e},r.create=function(e,n){return new nt(e,n)},r}(y),nt=function(t){m(r,t);function r(e,n){var i=t.call(this)||this;return i.destination=e,i.source=n,i}return r.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},r.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},r.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},r.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:X},r}(C),Yt=function(t){m(r,t);function r(e){var n=t.call(this)||this;return n._value=e,n}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},r.prototype.getValue=function(){var e=this,n=e.hasError,i=e.thrownError,o=e._value;if(n)throw i;return this._throwIfClosed(),o},r.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},r}(C),H={now:function(){return(H.delegate||Date).now()},delegate:void 0},it=function(t){m(r,t);function r(e,n,i){e===void 0&&(e=1/0),n===void 0&&(n=1/0),i===void 0&&(i=H);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}return r.prototype.next=function(e){var n=this,i=n.isStopped,o=n._buffer,u=n._infiniteTimeWindow,c=n._timestampProvider,a=n._windowTime;i||(o.push(e),!u&&o.push(c.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},r.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),i=this,o=i._infiniteTimeWindow,u=i._buffer,c=u.slice(),a=0;a<c.length&&!e.closed;a+=o?1:2)e.next(c[a]);return this._checkFinalizedStatuses(e),n},r.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,i=e._timestampProvider,o=e._buffer,u=e._infiniteTimeWindow,c=(u?1:2)*n;if(n<1/0&&c<o.length&&o.splice(0,o.length-c),!u){for(var a=i.now(),s=0,f=1;f<o.length&&o[f]<=a;f+=2)s=f;s&&o.splice(0,s+1)}},r}(C),qt=function(t){m(r,t);function r(e,n){return t.call(this)||this}return r.prototype.schedule=function(e,n){return this},r}(O),ot={setInterval:function(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setInterval.apply(void 0,I([t,r],E(e)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},Dt=function(t){m(r,t);function r(e,n){var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return r.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var o=this.id,u=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(u,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,n),this},r.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),ot.setInterval(e.flush.bind(e,this),i)},r.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ot.clearInterval(n)},r.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},r.prototype._execute=function(e,n){var i=!1,o;try{this.work(e)}catch(u){i=!0,o=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},r.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,F(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},r}(qt),ut=function(){function t(r,e){e===void 0&&(e=t.now),this.schedulerActionCtor=r,this.now=e}return t.prototype.schedule=function(r,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,r).schedule(n,e)},t.now=H.now,t}(),Gt=function(t){m(r,t);function r(e,n){n===void 0&&(n=ut.now);var i=t.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return r.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},r}(ut),Kt=new Gt(Dt);function Zt(t){return t&&v(t.schedule)}function ct(t){return t[t.length-1]}function Ht(t){return v(ct(t))?t.pop():void 0}function st(t){return Zt(ct(t))?t.pop():void 0}var at=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function ft(t){return v(t?.then)}function lt(t){return v(t[Z])}function ht(t){return Symbol.asyncIterator&&v(t?.[Symbol.asyncIterator])}function vt(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function $t(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dt=$t();function pt(t){return v(t?.[dt])}function yt(t){return Ot(this,arguments,function(){var e,n,i,o;return Q(this,function(u){switch(u.label){case 0:e=t.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,A(e.read())];case 3:return n=u.sent(),i=n.value,o=n.done,o?[4,A(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,A(i)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function bt(t){return v(t?.getReader)}function g(t){if(t instanceof y)return t;if(t!=null){if(lt(t))return Jt(t);if(at(t))return Bt(t);if(ft(t))return Qt(t);if(ht(t))return mt(t);if(pt(t))return Xt(t);if(bt(t))return zt(t)}throw vt(t)}function Jt(t){return new y(function(r){var e=t[Z]();if(v(e.subscribe))return e.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bt(t){return new y(function(r){for(var e=0;e<t.length&&!r.closed;e++)r.next(t[e]);r.complete()})}function Qt(t){return new y(function(r){t.then(function(e){r.closed||(r.next(e),r.complete())},function(e){return r.error(e)}).then(null,et)})}function Xt(t){return new y(function(r){var e,n;try{for(var i=x(t),o=i.next();!o.done;o=i.next()){var u=o.value;if(r.next(u),r.closed)return}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}r.complete()})}function mt(t){return new y(function(r){Nt(t,r).catch(function(e){return r.error(e)})})}function zt(t){return mt(yt(t))}function Nt(t,r){var e,n,i,o;return At(this,void 0,void 0,function(){var u,c;return Q(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),e=Pt(t),a.label=1;case 1:return[4,e.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(u=n.value,r.next(u),r.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=a.sent(),i={error:c},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=e.return)?[4,o.call(e)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}function _(t,r,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=r.schedule(function(){e(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(o),!i)return o}function wt(t,r){return r===void 0&&(r=0),w(function(e,n){e.subscribe(S(n,function(i){return _(n,t,function(){return n.next(i)},r)},function(){return _(n,t,function(){return n.complete()},r)},function(i){return _(n,t,function(){return n.error(i)},r)}))})}function St(t,r){return r===void 0&&(r=0),w(function(e,n){n.add(t.schedule(function(){return e.subscribe(n)},r))})}function te(t,r){return g(t).pipe(St(r),wt(r))}function ee(t,r){return g(t).pipe(St(r),wt(r))}function re(t,r){return new y(function(e){var n=0;return r.schedule(function(){n===t.length?e.complete():(e.next(t[n++]),e.closed||this.schedule())})})}function ne(t,r){return new y(function(e){var n;return _(e,r,function(){n=t[dt](),_(e,r,function(){var i,o,u;try{i=n.next(),o=i.value,u=i.done}catch(c){e.error(c);return}u?e.complete():e.next(o)},0,!0)}),function(){return v(n?.return)&&n.return()}})}function _t(t,r){if(!t)throw new Error("Iterable cannot be null");return new y(function(e){_(e,r,function(){var n=t[Symbol.asyncIterator]();_(e,r,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function ie(t,r){return _t(yt(t),r)}function oe(t,r){if(t!=null){if(lt(t))return te(t,r);if(at(t))return re(t,r);if(ft(t))return ee(t,r);if(ht(t))return _t(t,r);if(pt(t))return ne(t,r);if(bt(t))return ie(t,r)}throw vt(t)}function $(t,r){return r?oe(t,r):g(t)}function ue(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=st(t);return $(t,e)}var gt=Y(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function ce(t,r){var e=typeof r=="object";return new Promise(function(n,i){var o=!1,u;t.subscribe({next:function(c){u=c,o=!0},error:i,complete:function(){o?n(u):e?n(r.defaultValue):i(new gt)}})})}function se(t,r){var e=typeof r=="object";return new Promise(function(n,i){var o=new P({next:function(u){n(u),o.unsubscribe()},error:i,complete:function(){e?n(r.defaultValue):i(new gt)}});t.subscribe(o)})}function xt(t,r){return w(function(e,n){var i=0;e.subscribe(S(n,function(o){n.next(t.call(r,o,i++))}))})}var ae=Array.isArray;function fe(t,r){return ae(r)?t.apply(void 0,I([],E(r))):t(r)}function le(t){return xt(function(r){return fe(t,r)})}var he=Array.isArray,ve=Object.getPrototypeOf,de=Object.prototype,pe=Object.keys;function ye(t){if(t.length===1){var r=t[0];if(he(r))return{args:r,keys:null};if(be(r)){var e=pe(r);return{args:e.map(function(n){return r[n]}),keys:e}}}return{args:t,keys:null}}function be(t){return t&&typeof t=="object"&&ve(t)===de}function me(t,r){return t.reduce(function(e,n,i){return e[n]=r[i],e},{})}function we(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=st(t),n=Ht(t),i=ye(t),o=i.args,u=i.keys;if(o.length===0)return $([],e);var c=new y(Se(o,e,u?function(a){return me(u,a)}:j));return n?c.pipe(le(n)):c}function Se(t,r,e){return e===void 0&&(e=j),function(n){Et(r,function(){for(var i=t.length,o=new Array(i),u=i,c=i,a=function(f){Et(r,function(){var h=$(t[f],r),l=!1;h.subscribe(S(n,function(d){o[f]=d,l||(l=!0,c--),c||n.next(e(o.slice()))},function(){--u||n.complete()}))},n)},s=0;s<i;s++)a(s)},n)}}function Et(t,r,e){t?_(e,t,r):r()}function _e(t,r){return r===void 0&&(r=Kt),w(function(e,n){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var s=o;o=null,n.next(s)}};function a(){var s=u+t,f=r.now();if(f<s){i=this.schedule(void 0,s-f),n.add(i);return}c()}e.subscribe(S(n,function(s){o=s,u=r.now(),i||(i=r.schedule(a,t),n.add(i))},function(){c(),n.complete()},void 0,function(){o=i=null}))})}function ge(t,r){return r===void 0&&(r=j),t=t??xe,w(function(e,n){var i,o=!0;e.subscribe(S(n,function(u){var c=r(u);(o||!t(i,c))&&(o=!1,i=c,n.next(u))}))})}function xe(t,r){return t===r}function Ee(t){t===void 0&&(t={});var r=t.connector,e=r===void 0?function(){return new C}:r,n=t.resetOnError,i=n===void 0?!0:n,o=t.resetOnComplete,u=o===void 0?!0:o,c=t.resetOnRefCountZero,a=c===void 0?!0:c;return function(s){var f,h,l,d=0,b=!1,p=!1,k=function(){h?.unsubscribe(),h=void 0},W=function(){k(),f=l=void 0,b=p=!1},It=function(){var T=f;W(),T?.unsubscribe()};return w(function(T,B){d++,!p&&!b&&k();var R=l=l??e();B.add(function(){d--,d===0&&!p&&!b&&(h=J(It,a))}),R.subscribe(B),!f&&d>0&&(f=new P({next:function(U){return R.next(U)},error:function(U){p=!0,k(),h=J(W,i,U),R.error(U)},complete:function(){b=!0,k(),h=J(W,u),R.complete()}}),g(T).subscribe(f))})(s)}}function J(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];if(r===!0){t();return}if(r!==!1){var i=new P({next:function(){i.unsubscribe(),t()}});return g(r.apply(void 0,I([],E(e)))).subscribe(i)}}function Ie(t,r,e){var n,i,o,u,c=!1;return t&&typeof t=="object"?(n=t.bufferSize,u=n===void 0?1/0:n,i=t.windowTime,r=i===void 0?1/0:i,o=t.refCount,c=o===void 0?!1:o,e=t.scheduler):u=t??1/0,Ee({connector:function(){return new it(u,r,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}function Ae(t,r){return w(function(e,n){var i=null,o=0,u=!1,c=function(){return u&&!i&&n.complete()};e.subscribe(S(n,function(a){i?.unsubscribe();var s=0,f=o++;g(t(a,f)).subscribe(i=S(n,function(h){return n.next(r?r(a,h,f,s++):h)},function(){i=null,c()}))},function(){u=!0,c()}))})}function Oe(t){return w(function(r,e){g(t).subscribe(S(e,function(){return e.complete()},D)),!e.closed&&r.subscribe(e)})}function Pe(t,r,e){var n=v(t)||r||e?{next:t,error:r,complete:e}:t;return n?w(function(i,o){var u;(u=n.subscribe)===null||u===void 0||u.call(n);var c=!0;i.subscribe(S(o,function(a){var s;(s=n.next)===null||s===void 0||s.call(n,a),o.next(a)},function(){var a;c=!1,(a=n.complete)===null||a===void 0||a.call(n),o.complete()},function(a){var s;c=!1,(s=n.error)===null||s===void 0||s.call(n,a),o.error(a)},function(){var a,s;c&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(s=n.finalize)===null||s===void 0||s.call(n)}))}):j}export{Yt as BehaviorSubject,y as Observable,it as ReplaySubject,C as Subject,O as Subscription,we as combineLatest,_e as debounceTime,ge as distinctUntilChanged,se as firstValueFrom,ce as lastValueFrom,xt as map,ue as of,Ie as shareReplay,Ae as switchMap,Oe as takeUntil,Pe as tap};
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function F(t,r){if(t){var e=t.indexOf(r);0<=e&&t.splice(e,1)}}var O=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,e,n,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=x(u),s=c.next();!s.done;s=c.next()){var a=s.value;a.remove(this)}}catch(p){r={error:p}}finally{try{s&&!s.done&&(e=c.return)&&e.call(c)}finally{if(r)throw r.error}}else u.remove(this);var f=this.initialTeardown;if(v(f))try{f()}catch(p){o=p instanceof q?p.errors:[p]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=x(h),d=l.next();!d.done;d=l.next()){var b=d.value;try{N(b)}catch(p){o=o??[],p instanceof q?o=I(I([],E(o)),E(p.errors)):o.push(p)}}}catch(p){n={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}if(o)throw new q(o)}},t.prototype.add=function(r){var e;if(r&&r!==this)if(this.closed)N(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(r)}},t.prototype._hasParent=function(r){var e=this._parentage;return e===r||Array.isArray(e)&&e.includes(r)},t.prototype._addParent=function(r){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(r),e):e?[e,r]:r},t.prototype._removeParent=function(r){var e=this._parentage;e===r?this._parentage=null:Array.isArray(e)&&F(e,r)},t.prototype.remove=function(r){var e=this._finalizers;e&&F(e,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),X=O.EMPTY;function z(t){return t instanceof O||t&&"closed"in t&&v(t.remove)&&v(t.add)&&v(t.unsubscribe)}function N(t){v(t)?t():t.unsubscribe()}var tt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Tt={setTimeout:function(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,I([t,r],E(e)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function et(t){Tt.setTimeout(function(){throw t})}function D(){}function V(t){t()}var G=function(t){m(r,t);function r(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,z(e)&&e.add(n)):n.destination=Rt,n}return r.create=function(e,n,i){return new P(e,n,i)},r.prototype.next=function(e){this.isStopped||this._next(e)},r.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(O),jt=Function.prototype.bind;function K(t,r){return jt.call(t,r)}var Ct=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var e=this.partialObserver;if(e.next)try{e.next(r)}catch(n){L(n)}},t.prototype.error=function(r){var e=this.partialObserver;if(e.error)try{e.error(r)}catch(n){L(n)}else L(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(e){L(e)}},t}(),P=function(t){m(r,t);function r(e,n,i){var o=t.call(this)||this,u;if(v(e)||!e)u={next:e??void 0,error:n??void 0,complete:i??void 0};else{var c;o&&tt.useDeprecatedNextContext?(c=Object.create(e),c.unsubscribe=function(){return o.unsubscribe()},u={next:e.next&&K(e.next,c),error:e.error&&K(e.error,c),complete:e.complete&&K(e.complete,c)}):u=e}return o.destination=new Ct(u),o}return r}(G);function L(t){et(t)}function kt(t){throw t}var Rt={closed:!0,next:D,error:kt,complete:D},Z=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function j(t){return t}function Ut(t){return t.length===0?j:t.length===1?t[0]:function(e){return t.reduce(function(n,i){return i(n)},e)}}var y=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var e=new t;return e.source=this,e.operator=r,e},t.prototype.subscribe=function(r,e,n){var i=this,o=Vt(r)?r:new P(r,e,n);return V(function(){var u=i,c=u.operator,s=u.source;o.add(c?c.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(e){r.error(e)}},t.prototype.forEach=function(r,e){var n=this;return e=rt(e),new e(function(i,o){var u=new P({next:function(c){try{r(c)}catch(s){o(s),u.unsubscribe()}},error:o,complete:i});n.subscribe(u)})},t.prototype._subscribe=function(r){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(r)},t.prototype[Z]=function(){return this},t.prototype.pipe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Ut(r)(this)},t.prototype.toPromise=function(r){var e=this;return r=rt(r),new r(function(n,i){var o;e.subscribe(function(u){return o=u},function(u){return i(u)},function(){return n(o)})})},t.create=function(r){return new t(r)},t}();function rt(t){var r;return(r=t??tt.Promise)!==null&&r!==void 0?r:Promise}function Ft(t){return t&&v(t.next)&&v(t.error)&&v(t.complete)}function Vt(t){return t&&t instanceof G||Ft(t)&&z(t)}function Lt(t){return v(t?.lift)}function w(t){return function(r){if(Lt(r))return r.lift(function(e){try{return t(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function S(t,r,e,n,i){return new Wt(t,r,e,n,i)}var Wt=function(t){m(r,t);function r(e,n,i,o,u,c){var s=t.call(this,e)||this;return s.onFinalize=u,s.shouldUnsubscribe=c,s._next=n?function(a){try{n(a)}catch(f){e.error(f)}}:t.prototype._next,s._error=o?function(a){try{o(a)}catch(f){e.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(a){e.error(a)}finally{this.unsubscribe()}}:t.prototype._complete,s}return r.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},r}(G),Mt=Y(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),C=function(t){m(r,t);function r(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.prototype.lift=function(e){var n=new nt(this,this);return n.operator=e,n},r.prototype._throwIfClosed=function(){if(this.closed)throw new Mt},r.prototype.next=function(e){var n=this;V(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var u=x(n.currentObservers),c=u.next();!c.done;c=u.next()){var s=c.value;s.next(e)}}catch(a){i={error:a}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}})},r.prototype.error=function(e){var n=this;V(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},r.prototype.complete=function(){var e=this;V(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},r.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},r.prototype._innerSubscribe=function(e){var n=this,i=this,o=i.hasError,u=i.isStopped,c=i.observers;return o||u?X:(this.currentObservers=null,c.push(e),new O(function(){n.currentObservers=null,F(c,e)}))},r.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,o=n.thrownError,u=n.isStopped;i?e.error(o):u&&e.complete()},r.prototype.asObservable=function(){var e=new y;return e.source=this,e},r.create=function(e,n){return new nt(e,n)},r}(y),nt=function(t){m(r,t);function r(e,n){var i=t.call(this)||this;return i.destination=e,i.source=n,i}return r.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},r.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},r.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},r.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:X},r}(C),Yt=function(t){m(r,t);function r(e){var n=t.call(this)||this;return n._value=e,n}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},r.prototype.getValue=function(){var e=this,n=e.hasError,i=e.thrownError,o=e._value;if(n)throw i;return this._throwIfClosed(),o},r.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},r}(C),H={now:function(){return(H.delegate||Date).now()},delegate:void 0},it=function(t){m(r,t);function r(e,n,i){e===void 0&&(e=1/0),n===void 0&&(n=1/0),i===void 0&&(i=H);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}return r.prototype.next=function(e){var n=this,i=n.isStopped,o=n._buffer,u=n._infiniteTimeWindow,c=n._timestampProvider,s=n._windowTime;i||(o.push(e),!u&&o.push(c.now()+s)),this._trimBuffer(),t.prototype.next.call(this,e)},r.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),i=this,o=i._infiniteTimeWindow,u=i._buffer,c=u.slice(),s=0;s<c.length&&!e.closed;s+=o?1:2)e.next(c[s]);return this._checkFinalizedStatuses(e),n},r.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,i=e._timestampProvider,o=e._buffer,u=e._infiniteTimeWindow,c=(u?1:2)*n;if(n<1/0&&c<o.length&&o.splice(0,o.length-c),!u){for(var s=i.now(),a=0,f=1;f<o.length&&o[f]<=s;f+=2)a=f;a&&o.splice(0,a+1)}},r}(C),qt=function(t){m(r,t);function r(e,n){return t.call(this)||this}return r.prototype.schedule=function(e,n){return this},r}(O),ot={setInterval:function(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setInterval.apply(void 0,I([t,r],E(e)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},Dt=function(t){m(r,t);function r(e,n){var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return r.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var o=this.id,u=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(u,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,n),this},r.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),ot.setInterval(e.flush.bind(e,this),i)},r.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ot.clearInterval(n)},r.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},r.prototype._execute=function(e,n){var i=!1,o;try{this.work(e)}catch(u){i=!0,o=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},r.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,F(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},r}(qt),ut=function(){function t(r,e){e===void 0&&(e=t.now),this.schedulerActionCtor=r,this.now=e}return t.prototype.schedule=function(r,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,r).schedule(n,e)},t.now=H.now,t}(),Gt=function(t){m(r,t);function r(e,n){n===void 0&&(n=ut.now);var i=t.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return r.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},r}(ut),Kt=new Gt(Dt);function Zt(t){return t&&v(t.schedule)}function ct(t){return t[t.length-1]}function Ht(t){return v(ct(t))?t.pop():void 0}function at(t){return Zt(ct(t))?t.pop():void 0}var st=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function ft(t){return v(t?.then)}function lt(t){return v(t[Z])}function ht(t){return Symbol.asyncIterator&&v(t?.[Symbol.asyncIterator])}function vt(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function $t(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dt=$t();function pt(t){return v(t?.[dt])}function yt(t){return Ot(this,arguments,function(){var e,n,i,o;return Q(this,function(u){switch(u.label){case 0:e=t.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,A(e.read())];case 3:return n=u.sent(),i=n.value,o=n.done,o?[4,A(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,A(i)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function bt(t){return v(t?.getReader)}function g(t){if(t instanceof y)return t;if(t!=null){if(lt(t))return Jt(t);if(st(t))return Bt(t);if(ft(t))return Qt(t);if(ht(t))return mt(t);if(pt(t))return Xt(t);if(bt(t))return zt(t)}throw vt(t)}function Jt(t){return new y(function(r){var e=t[Z]();if(v(e.subscribe))return e.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bt(t){return new y(function(r){for(var e=0;e<t.length&&!r.closed;e++)r.next(t[e]);r.complete()})}function Qt(t){return new y(function(r){t.then(function(e){r.closed||(r.next(e),r.complete())},function(e){return r.error(e)}).then(null,et)})}function Xt(t){return new y(function(r){var e,n;try{for(var i=x(t),o=i.next();!o.done;o=i.next()){var u=o.value;if(r.next(u),r.closed)return}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}r.complete()})}function mt(t){return new y(function(r){Nt(t,r).catch(function(e){return r.error(e)})})}function zt(t){return mt(yt(t))}function Nt(t,r){var e,n,i,o;return At(this,void 0,void 0,function(){var u,c;return Q(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),e=Pt(t),s.label=1;case 1:return[4,e.next()];case 2:if(n=s.sent(),!!n.done)return[3,4];if(u=n.value,r.next(u),r.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),i={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),n&&!n.done&&(o=e.return)?[4,o.call(e)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}function _(t,r,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=r.schedule(function(){e(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(o),!i)return o}function wt(t,r){return r===void 0&&(r=0),w(function(e,n){e.subscribe(S(n,function(i){return _(n,t,function(){return n.next(i)},r)},function(){return _(n,t,function(){return n.complete()},r)},function(i){return _(n,t,function(){return n.error(i)},r)}))})}function St(t,r){return r===void 0&&(r=0),w(function(e,n){n.add(t.schedule(function(){return e.subscribe(n)},r))})}function te(t,r){return g(t).pipe(St(r),wt(r))}function ee(t,r){return g(t).pipe(St(r),wt(r))}function re(t,r){return new y(function(e){var n=0;return r.schedule(function(){n===t.length?e.complete():(e.next(t[n++]),e.closed||this.schedule())})})}function ne(t,r){return new y(function(e){var n;return _(e,r,function(){n=t[dt](),_(e,r,function(){var i,o,u;try{i=n.next(),o=i.value,u=i.done}catch(c){e.error(c);return}u?e.complete():e.next(o)},0,!0)}),function(){return v(n?.return)&&n.return()}})}function _t(t,r){if(!t)throw new Error("Iterable cannot be null");return new y(function(e){_(e,r,function(){var n=t[Symbol.asyncIterator]();_(e,r,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function ie(t,r){return _t(yt(t),r)}function oe(t,r){if(t!=null){if(lt(t))return te(t,r);if(st(t))return re(t,r);if(ft(t))return ee(t,r);if(ht(t))return _t(t,r);if(pt(t))return ne(t,r);if(bt(t))return ie(t,r)}throw vt(t)}function $(t,r){return r?oe(t,r):g(t)}function ue(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=at(t);return $(t,e)}var gt=Y(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function ce(t,r){var e=typeof r=="object";return new Promise(function(n,i){var o=!1,u;t.subscribe({next:function(c){u=c,o=!0},error:i,complete:function(){o?n(u):e?n(r.defaultValue):i(new gt)}})})}function ae(t,r){var e=typeof r=="object";return new Promise(function(n,i){var o=new P({next:function(u){n(u),o.unsubscribe()},error:i,complete:function(){e?n(r.defaultValue):i(new gt)}});t.subscribe(o)})}function xt(t,r){return w(function(e,n){var i=0;e.subscribe(S(n,function(o){n.next(t.call(r,o,i++))}))})}var se=Array.isArray;function fe(t,r){return se(r)?t.apply(void 0,I([],E(r))):t(r)}function le(t){return xt(function(r){return fe(t,r)})}var he=Array.isArray,ve=Object.getPrototypeOf,de=Object.prototype,pe=Object.keys;function ye(t){if(t.length===1){var r=t[0];if(he(r))return{args:r,keys:null};if(be(r)){var e=pe(r);return{args:e.map(function(n){return r[n]}),keys:e}}}return{args:t,keys:null}}function be(t){return t&&typeof t=="object"&&ve(t)===de}function me(t,r){return t.reduce(function(e,n,i){return e[n]=r[i],e},{})}function we(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=at(t),n=Ht(t),i=ye(t),o=i.args,u=i.keys;if(o.length===0)return $([],e);var c=new y(Se(o,e,u?function(s){return me(u,s)}:j));return n?c.pipe(le(n)):c}function Se(t,r,e){return e===void 0&&(e=j),function(n){Et(r,function(){for(var i=t.length,o=new Array(i),u=i,c=i,s=function(f){Et(r,function(){var h=$(t[f],r),l=!1;h.subscribe(S(n,function(d){o[f]=d,l||(l=!0,c--),c||n.next(e(o.slice()))},function(){--u||n.complete()}))},n)},a=0;a<i;a++)s(a)},n)}}function Et(t,r,e){t?_(e,t,r):r()}function _e(t,r){return w(function(e,n){var i=0;e.subscribe(S(n,function(o){return t.call(r,o,i++)&&n.next(o)}))})}function ge(t,r){return r===void 0&&(r=Kt),w(function(e,n){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var a=o;o=null,n.next(a)}};function s(){var a=u+t,f=r.now();if(f<a){i=this.schedule(void 0,a-f),n.add(i);return}c()}e.subscribe(S(n,function(a){o=a,u=r.now(),i||(i=r.schedule(s,t),n.add(i))},function(){c(),n.complete()},void 0,function(){o=i=null}))})}function xe(t,r){return r===void 0&&(r=j),t=t??Ee,w(function(e,n){var i,o=!0;e.subscribe(S(n,function(u){var c=r(u);(o||!t(i,c))&&(o=!1,i=c,n.next(u))}))})}function Ee(t,r){return t===r}function Ie(t){t===void 0&&(t={});var r=t.connector,e=r===void 0?function(){return new C}:r,n=t.resetOnError,i=n===void 0?!0:n,o=t.resetOnComplete,u=o===void 0?!0:o,c=t.resetOnRefCountZero,s=c===void 0?!0:c;return function(a){var f,h,l,d=0,b=!1,p=!1,k=function(){h?.unsubscribe(),h=void 0},W=function(){k(),f=l=void 0,b=p=!1},It=function(){var T=f;W(),T?.unsubscribe()};return w(function(T,B){d++,!p&&!b&&k();var R=l=l??e();B.add(function(){d--,d===0&&!p&&!b&&(h=J(It,s))}),R.subscribe(B),!f&&d>0&&(f=new P({next:function(U){return R.next(U)},error:function(U){p=!0,k(),h=J(W,i,U),R.error(U)},complete:function(){b=!0,k(),h=J(W,u),R.complete()}}),g(T).subscribe(f))})(a)}}function J(t,r){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];if(r===!0){t();return}if(r!==!1){var i=new P({next:function(){i.unsubscribe(),t()}});return g(r.apply(void 0,I([],E(e)))).subscribe(i)}}function Ae(t,r,e){var n,i,o,u,c=!1;return t&&typeof t=="object"?(n=t.bufferSize,u=n===void 0?1/0:n,i=t.windowTime,r=i===void 0?1/0:i,o=t.refCount,c=o===void 0?!1:o,e=t.scheduler):u=t??1/0,Ie({connector:function(){return new it(u,r,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}function Oe(t,r){return w(function(e,n){var i=null,o=0,u=!1,c=function(){return u&&!i&&n.complete()};e.subscribe(S(n,function(s){i?.unsubscribe();var a=0,f=o++;g(t(s,f)).subscribe(i=S(n,function(h){return n.next(r?r(s,h,f,a++):h)},function(){i=null,c()}))},function(){u=!0,c()}))})}function Pe(t){return w(function(r,e){g(t).subscribe(S(e,function(){return e.complete()},D)),!e.closed&&r.subscribe(e)})}function Te(t,r,e){var n=v(t)||r||e?{next:t,error:r,complete:e}:t;return n?w(function(i,o){var u;(u=n.subscribe)===null||u===void 0||u.call(n);var c=!0;i.subscribe(S(o,function(s){var a;(a=n.next)===null||a===void 0||a.call(n,s),o.next(s)},function(){var s;c=!1,(s=n.complete)===null||s===void 0||s.call(n),o.complete()},function(s){var a;c=!1,(a=n.error)===null||a===void 0||a.call(n,s),o.error(s)},function(){var s,a;c&&((s=n.unsubscribe)===null||s===void 0||s.call(n)),(a=n.finalize)===null||a===void 0||a.call(n)}))}):j}export{Yt as BehaviorSubject,y as Observable,it as ReplaySubject,C as Subject,O as Subscription,we as combineLatest,ge as debounceTime,xe as distinctUntilChanged,_e as filter,ae as firstValueFrom,ce as lastValueFrom,xt as map,ue as of,Ae as shareReplay,Oe as switchMap,Pe as takeUntil,Te as tap};
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
1
|
import { UmbLocalizeController } from '../localization-api/index.js';
|
|
8
2
|
import { UmbControllerHostElementMixin } from '../controller-api/index.js';
|
|
9
3
|
import { UmbContextConsumerController, UmbContextProviderController, } from '../context-api/index.js';
|
|
10
4
|
import { UmbObserverController } from '../observable-api/index.js';
|
|
11
|
-
import { property } from '../../external/lit/index.js';
|
|
12
5
|
export const UmbElementMixin = (superClass) => {
|
|
13
6
|
class UmbElementMixinClass extends UmbControllerHostElementMixin(superClass) {
|
|
14
7
|
constructor() {
|
|
15
8
|
super(...arguments);
|
|
16
|
-
// Make `dir` and `lang` reactive properties so they react to language changes:
|
|
17
|
-
this.dir = '';
|
|
18
|
-
this.lang = '';
|
|
19
9
|
this.localize = new UmbLocalizeController(this);
|
|
20
10
|
}
|
|
21
11
|
/**
|
|
@@ -49,11 +39,5 @@ export const UmbElementMixin = (superClass) => {
|
|
|
49
39
|
return new UmbContextConsumerController(this, alias, callback);
|
|
50
40
|
}
|
|
51
41
|
}
|
|
52
|
-
__decorate([
|
|
53
|
-
property()
|
|
54
|
-
], UmbElementMixinClass.prototype, "dir", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
property()
|
|
57
|
-
], UmbElementMixinClass.prototype, "lang", void 0);
|
|
58
42
|
return UmbElementMixinClass;
|
|
59
43
|
};
|
|
@@ -12,6 +12,7 @@ export declare class UmbExtensionRegistry<IncomingManifestTypes extends Manifest
|
|
|
12
12
|
unregisterMany(aliases: Array<string>): void;
|
|
13
13
|
unregister(alias: string): void;
|
|
14
14
|
isRegistered(alias: string): boolean;
|
|
15
|
+
private checkExtension;
|
|
15
16
|
private _kindsOfType;
|
|
16
17
|
private _extensionsOfType;
|
|
17
18
|
private _kindsOfTypes;
|
|
@@ -68,28 +68,15 @@ export class UmbExtensionRegistry {
|
|
|
68
68
|
this._kinds.next(nextData);
|
|
69
69
|
}
|
|
70
70
|
register(manifest) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (!manifest.alias) {
|
|
76
|
-
console.error(`Extension is missing alias`, manifest);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (manifest.type === 'kind') {
|
|
80
|
-
this.defineKind(manifest);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const extensionsValues = this._extensions.getValue();
|
|
84
|
-
const extension = extensionsValues.find((extension) => extension.alias === manifest.alias);
|
|
85
|
-
if (extension) {
|
|
86
|
-
console.error(`Extension with alias ${manifest.alias} is already registered`);
|
|
71
|
+
const isValid = this.checkExtension(manifest);
|
|
72
|
+
if (!isValid) {
|
|
87
73
|
return;
|
|
88
74
|
}
|
|
89
|
-
this._extensions.next([...
|
|
75
|
+
this._extensions.next([...this._extensions.getValue(), manifest]);
|
|
90
76
|
}
|
|
91
77
|
registerMany(manifests) {
|
|
92
|
-
manifests.
|
|
78
|
+
const validManifests = manifests.filter(this.checkExtension.bind(this));
|
|
79
|
+
this._extensions.next([...this._extensions.getValue(), ...validManifests]);
|
|
93
80
|
}
|
|
94
81
|
unregisterMany(aliases) {
|
|
95
82
|
aliases.forEach((alias) => this.unregister(alias));
|
|
@@ -115,6 +102,27 @@ export class UmbExtensionRegistry {
|
|
|
115
102
|
return this.extensions.pipe(map((extensions) => extensions.find((extension) => extension.alias === alias) || null));
|
|
116
103
|
}
|
|
117
104
|
*/
|
|
105
|
+
checkExtension(manifest) {
|
|
106
|
+
if (!manifest.type) {
|
|
107
|
+
console.error(`Extension is missing type`, manifest);
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (!manifest.alias) {
|
|
111
|
+
console.error(`Extension is missing alias`, manifest);
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (manifest.type === 'kind') {
|
|
115
|
+
this.defineKind(manifest);
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
const extensionsValues = this._extensions.getValue();
|
|
119
|
+
const extension = extensionsValues.find((extension) => extension.alias === manifest.alias);
|
|
120
|
+
if (extension) {
|
|
121
|
+
console.error(`Extension with alias ${manifest.alias} is already registered`);
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
118
126
|
_kindsOfType(type) {
|
|
119
127
|
return this.kinds.pipe(map((kinds) => kinds.filter((kind) => kind.matchType === type)), distinctUntilChanged(extensionArrayMemoization));
|
|
120
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerTranslation, translations, } from '../../../../libs/localization-api/index.js';
|
|
2
2
|
import { hasDefaultExport, loadExtension } from '../../../../libs/extension-api/index.js';
|
|
3
3
|
import { umbExtensionsRegistry } from '../../extension-registry/index.js';
|
|
4
|
-
import { Subject, combineLatest, map, distinctUntilChanged } from '../../../../external/rxjs/index.js';
|
|
4
|
+
import { Subject, combineLatest, map, distinctUntilChanged, filter } from '../../../../external/rxjs/index.js';
|
|
5
5
|
export class UmbTranslationRegistry {
|
|
6
6
|
/**
|
|
7
7
|
* Get the current registered translations.
|
|
@@ -10,9 +10,10 @@ export class UmbTranslationRegistry {
|
|
|
10
10
|
return translations;
|
|
11
11
|
}
|
|
12
12
|
#currentLanguage = new Subject();
|
|
13
|
-
#currentLanguageUnique = this.#currentLanguage.pipe(map((x) => x.toLowerCase()), distinctUntilChanged());
|
|
14
13
|
constructor(extensionRegistry) {
|
|
15
|
-
|
|
14
|
+
const currentLanguage$ = this.#currentLanguage.pipe(map((x) => x.toLowerCase()), distinctUntilChanged());
|
|
15
|
+
const currentExtensions$ = extensionRegistry.extensionsOfType('translations').pipe(filter((x) => x.length > 0), distinctUntilChanged((prev, curr) => prev.length === curr.length && prev.every((x) => curr.includes(x))));
|
|
16
|
+
combineLatest([currentLanguage$, currentExtensions$]).subscribe(async ([userCulture, extensions]) => {
|
|
16
17
|
const locale = new Intl.Locale(userCulture);
|
|
17
18
|
const translations = await Promise.all(extensions
|
|
18
19
|
.filter((x) => x.meta.culture.toLowerCase() === locale.baseName.toLowerCase() ||
|
|
@@ -42,9 +43,15 @@ export class UmbTranslationRegistry {
|
|
|
42
43
|
if (translations.length) {
|
|
43
44
|
registerTranslation(...translations);
|
|
44
45
|
// Set the document language
|
|
45
|
-
|
|
46
|
+
const newLang = locale.baseName.toLowerCase();
|
|
47
|
+
if (document.documentElement.lang.toLowerCase() !== newLang) {
|
|
48
|
+
document.documentElement.lang = newLang;
|
|
49
|
+
}
|
|
46
50
|
// Set the document direction to the direction of the primary language
|
|
47
|
-
|
|
51
|
+
const newDir = translations[0].$dir ?? 'ltr';
|
|
52
|
+
if (document.documentElement.dir !== newDir) {
|
|
53
|
+
document.documentElement.dir = newDir;
|
|
54
|
+
}
|
|
48
55
|
}
|
|
49
56
|
});
|
|
50
57
|
}
|
|
@@ -421,8 +421,14 @@ export class UmbSorterController {
|
|
|
421
421
|
};
|
|
422
422
|
// TODO: Move auto scroll into its own class?
|
|
423
423
|
this.#autoScrollRAF = null;
|
|
424
|
+
this.#autoScrollEl = document.scrollingElement || document.documentElement;
|
|
424
425
|
this.autoScrollX = 0;
|
|
425
426
|
this.autoScrollY = 0;
|
|
427
|
+
this._performAutoScroll = () => {
|
|
428
|
+
this.#autoScrollEl.scrollLeft += this.autoScrollX * autoScrollSpeed;
|
|
429
|
+
this.#autoScrollEl.scrollTop += this.autoScrollY * autoScrollSpeed;
|
|
430
|
+
this.#autoScrollRAF = requestAnimationFrame(this._performAutoScroll);
|
|
431
|
+
};
|
|
426
432
|
this.#host = host;
|
|
427
433
|
// Set defaults:
|
|
428
434
|
config.ignorerSelector ??= 'a, img, iframe';
|
|
@@ -640,11 +646,6 @@ export class UmbSorterController {
|
|
|
640
646
|
this.#autoScrollRAF = requestAnimationFrame(this._performAutoScroll);
|
|
641
647
|
}
|
|
642
648
|
}
|
|
643
|
-
_performAutoScroll() {
|
|
644
|
-
this.#autoScrollEl.scrollLeft += this.autoScrollX * autoScrollSpeed;
|
|
645
|
-
this.#autoScrollEl.scrollTop += this.autoScrollY * autoScrollSpeed;
|
|
646
|
-
this.#autoScrollRAF = requestAnimationFrame(this._performAutoScroll);
|
|
647
|
-
}
|
|
648
649
|
stopAutoScroll() {
|
|
649
650
|
cancelAnimationFrame(this.#autoScrollRAF);
|
|
650
651
|
this.#autoScrollRAF = null;
|
|
@@ -680,6 +681,5 @@ export class UmbSorterController {
|
|
|
680
681
|
this.#observer.disconnect();
|
|
681
682
|
// For auto scroller:
|
|
682
683
|
this.#scrollElement = null;
|
|
683
|
-
this.#autoScrollEl = undefined;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UmbSorterController } from '../sorter.controller.js';
|
|
2
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
|
+
type SortEntryType = {
|
|
4
|
+
id: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export default class UmbTestSorterControllerElement extends UmbLitElement {
|
|
8
|
+
sorter: UmbSorterController<SortEntryType>;
|
|
9
|
+
constructor();
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbSorterController } from '../sorter.controller.js';
|
|
8
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
9
|
+
import { css, customElement, html } from '../../../../external/lit/index.js';
|
|
10
|
+
const sorterConfig = {
|
|
11
|
+
compareElementToModel: (element, model) => {
|
|
12
|
+
return element.getAttribute('data-sort-entry-id') === model.id;
|
|
13
|
+
},
|
|
14
|
+
querySelectModelToElement: (container, modelEntry) => {
|
|
15
|
+
return container.querySelector('data-sort-entry-id[' + modelEntry.id + ']');
|
|
16
|
+
},
|
|
17
|
+
identifier: 'test-sorter',
|
|
18
|
+
itemSelector: 'li',
|
|
19
|
+
containerSelector: 'ul',
|
|
20
|
+
};
|
|
21
|
+
const model = [
|
|
22
|
+
{
|
|
23
|
+
id: '0',
|
|
24
|
+
value: 'Entry 0',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: '1',
|
|
28
|
+
value: 'Entry 1',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: '2',
|
|
32
|
+
value: 'Entry 2',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
let UmbTestSorterControllerElement = class UmbTestSorterControllerElement extends UmbLitElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super();
|
|
38
|
+
this.sorter = new UmbSorterController(this, sorterConfig);
|
|
39
|
+
this.sorter.setModel(model);
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return html `
|
|
43
|
+
<ul>
|
|
44
|
+
${model.map((entry) => html `<li id="${'sort' + entry.id}" data-sort-entry-id="${entry.id}">${entry.value}</li>`)}
|
|
45
|
+
</ul>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
static { this.styles = [
|
|
49
|
+
css `
|
|
50
|
+
:host {
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ul {
|
|
55
|
+
list-style: none;
|
|
56
|
+
padding: 0;
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
li {
|
|
61
|
+
padding: 10px;
|
|
62
|
+
margin: 5px;
|
|
63
|
+
background: #eee;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
li:hover {
|
|
67
|
+
background: #ddd !important;
|
|
68
|
+
cursor: move;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
li:active {
|
|
72
|
+
background: #ccc;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#sort0 {
|
|
76
|
+
background: #f00;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#sort1 {
|
|
80
|
+
background: #0f0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#sort2 {
|
|
84
|
+
background: #c9da10;
|
|
85
|
+
}
|
|
86
|
+
`,
|
|
87
|
+
]; }
|
|
88
|
+
};
|
|
89
|
+
UmbTestSorterControllerElement = __decorate([
|
|
90
|
+
customElement('test-my-sorter-controller')
|
|
91
|
+
], UmbTestSorterControllerElement);
|
|
92
|
+
export default UmbTestSorterControllerElement;
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { LitElement } from '../../external/lit/index.js';
|
|
2
2
|
declare const UmbLitElement_base: import("../../libs/extension-api/index.js").HTMLElementConstructor<import("../../libs/element-api/index.js").UmbElement> & typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* The base class for all Umbraco LitElement elements.
|
|
5
|
+
*
|
|
6
|
+
* @abstract
|
|
7
|
+
* @remarks This class is a wrapper around the LitElement class.
|
|
8
|
+
* @remarks The `dir` and `lang` properties are defined here as reactive properties so they react to language changes.
|
|
9
|
+
*/
|
|
3
10
|
export declare class UmbLitElement extends UmbLitElement_base {
|
|
11
|
+
/**
|
|
12
|
+
* The direction of the element.
|
|
13
|
+
*
|
|
14
|
+
* @attr
|
|
15
|
+
* @remarks This is the direction of the element, not the direction of the backoffice.
|
|
16
|
+
* @example 'ltr'
|
|
17
|
+
* @example 'rtl'
|
|
18
|
+
*/
|
|
19
|
+
dir: 'rtl' | 'ltr' | '';
|
|
20
|
+
/**
|
|
21
|
+
* The language of the element.
|
|
22
|
+
*
|
|
23
|
+
* @attr
|
|
24
|
+
* @remarks This is the language of the element, not the language of the backoffice.
|
|
25
|
+
* @example 'en-us'
|
|
26
|
+
* @example 'en'
|
|
27
|
+
*/
|
|
28
|
+
lang: string;
|
|
4
29
|
}
|
|
5
30
|
export {};
|
|
@@ -1,4 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, property } from '../../external/lit/index.js';
|
|
2
8
|
import { UmbElementMixin } from '../../libs/element-api/index.js';
|
|
9
|
+
// TODO: Currently we don't check if the `lang` is registered in the backoffice. We should do that. We can do that by checking if the `lang` is in the `languages` array of the `language` resource and potentially make sure that UmbTranslationRegistry only loads the translations and some other mechanism reloads to another language (currently it does both)
|
|
10
|
+
/**
|
|
11
|
+
* The base class for all Umbraco LitElement elements.
|
|
12
|
+
*
|
|
13
|
+
* @abstract
|
|
14
|
+
* @remarks This class is a wrapper around the LitElement class.
|
|
15
|
+
* @remarks The `dir` and `lang` properties are defined here as reactive properties so they react to language changes.
|
|
16
|
+
*/
|
|
3
17
|
export class UmbLitElement extends UmbElementMixin(LitElement) {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* The direction of the element.
|
|
22
|
+
*
|
|
23
|
+
* @attr
|
|
24
|
+
* @remarks This is the direction of the element, not the direction of the backoffice.
|
|
25
|
+
* @example 'ltr'
|
|
26
|
+
* @example 'rtl'
|
|
27
|
+
*/
|
|
28
|
+
this.dir = '';
|
|
29
|
+
/**
|
|
30
|
+
* The language of the element.
|
|
31
|
+
*
|
|
32
|
+
* @attr
|
|
33
|
+
* @remarks This is the language of the element, not the language of the backoffice.
|
|
34
|
+
* @example 'en-us'
|
|
35
|
+
* @example 'en'
|
|
36
|
+
*/
|
|
37
|
+
this.lang = '';
|
|
38
|
+
}
|
|
4
39
|
}
|
|
40
|
+
__decorate([
|
|
41
|
+
property()
|
|
42
|
+
], UmbLitElement.prototype, "dir", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
property()
|
|
45
|
+
], UmbLitElement.prototype, "lang", void 0);
|