@shoper/phoenix_design_system 0.0.3 → 0.1.0
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/build/esm/external/tslib/tslib.es6.js +14 -1
- package/build/esm/external/tslib/tslib.es6.js.map +1 -1
- package/build/esm/packages/phoenix/src/context/context_consumer_controller.d.ts +8 -0
- package/build/esm/packages/phoenix/src/context/context_consumer_controller.js +28 -0
- package/build/esm/packages/phoenix/src/context/context_consumer_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/context/context_consumer_messages_names.d.ts +3 -0
- package/build/esm/packages/phoenix/src/context/context_consumer_messages_names.js +6 -0
- package/build/esm/packages/phoenix/src/context/context_consumer_messages_names.js.map +1 -0
- package/build/esm/packages/phoenix/src/context/context_controller_types.d.ts +5 -0
- package/build/esm/packages/phoenix/src/context/context_controller_types.js +2 -0
- package/build/esm/packages/phoenix/src/context/context_controller_types.js.map +1 -0
- package/build/esm/packages/phoenix/src/context/context_provider_controller.d.ts +9 -0
- package/build/esm/packages/phoenix/src/context/context_provider_controller.js +35 -0
- package/build/esm/packages/phoenix/src/context/context_provider_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/index.d.ts +2 -0
- package/build/esm/packages/phoenix/src/index.js +2 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js +30 -0
- package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js.map +1 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js +62 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js.map +1 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js +7 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js.map +1 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js +16 -0
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js.map +1 -0
- package/package.json +1 -1
|
@@ -22,7 +22,20 @@ function __decorate(decorators, target, key, desc) {
|
|
|
22
22
|
|
|
23
23
|
function __metadata(metadataKey, metadataValue) {
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
28
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
34
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
35
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
36
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
37
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
25
38
|
}
|
|
26
39
|
|
|
27
|
-
export { __decorate, __metadata };
|
|
40
|
+
export { __classPrivateFieldGet, __classPrivateFieldSet, __decorate, __metadata };
|
|
28
41
|
//# sourceMappingURL=tslib.es6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
import { TWebComponentsContextControllerHost } from "./context_controller_types";
|
|
3
|
+
export declare class ContextConsumerController<TKey extends string, TValue> implements ReactiveController {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(host: TWebComponentsContextControllerHost);
|
|
6
|
+
consume(key: TKey): TValue;
|
|
7
|
+
hostConnected(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import 'lit';
|
|
3
|
+
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
4
|
+
|
|
5
|
+
var _ContextConsumerController_host;
|
|
6
|
+
class ContextConsumerController {
|
|
7
|
+
constructor(host) {
|
|
8
|
+
_ContextConsumerController_host.set(this, void 0);
|
|
9
|
+
__classPrivateFieldSet(this, _ContextConsumerController_host, host, "f");
|
|
10
|
+
__classPrivateFieldGet(this, _ContextConsumerController_host, "f").addController(this);
|
|
11
|
+
}
|
|
12
|
+
consume(key) {
|
|
13
|
+
const consumeEvent = new CustomEvent(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, {
|
|
14
|
+
bubbles: true,
|
|
15
|
+
cancelable: true,
|
|
16
|
+
detail: { key }
|
|
17
|
+
});
|
|
18
|
+
__classPrivateFieldGet(this, _ContextConsumerController_host, "f").dispatchEvent(consumeEvent);
|
|
19
|
+
return consumeEvent.detail[key];
|
|
20
|
+
}
|
|
21
|
+
// Added to fix typescript error
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23
|
+
hostConnected() { }
|
|
24
|
+
}
|
|
25
|
+
_ContextConsumerController_host = new WeakMap();
|
|
26
|
+
|
|
27
|
+
export { ContextConsumerController };
|
|
28
|
+
//# sourceMappingURL=context_consumer_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,yCAA6C;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context_controller_types.js","sourceRoot":"","sources":["../../../../../../src/context/context_controller_types.ts"],"names":[],"mappings":"AAAA,OAAuC,KAAK,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
import { TWebComponentsContextControllerHost } from "./context_controller_types";
|
|
3
|
+
export declare class ContextProviderController<TKey extends string, TValue> implements ReactiveController {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(host: TWebComponentsContextControllerHost);
|
|
6
|
+
provide(key: TKey, value: TValue): void;
|
|
7
|
+
hostConnected(): void;
|
|
8
|
+
hostDisconnected(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import 'lit';
|
|
3
|
+
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
4
|
+
import { ValuesContainer } from '../../../star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js';
|
|
5
|
+
|
|
6
|
+
var _ContextProviderController_host, _ContextProviderController_contextValues, _ContextProviderController_handleRequestedValue;
|
|
7
|
+
class ContextProviderController {
|
|
8
|
+
constructor(host) {
|
|
9
|
+
_ContextProviderController_host.set(this, void 0);
|
|
10
|
+
_ContextProviderController_contextValues.set(this, new ValuesContainer());
|
|
11
|
+
_ContextProviderController_handleRequestedValue.set(this, (event) => {
|
|
12
|
+
const customEvent = event;
|
|
13
|
+
const valueKey = customEvent.detail.key;
|
|
14
|
+
if (!__classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").has(valueKey))
|
|
15
|
+
return;
|
|
16
|
+
customEvent.detail[valueKey] = __classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").get(valueKey);
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
});
|
|
19
|
+
__classPrivateFieldSet(this, _ContextProviderController_host, host, "f");
|
|
20
|
+
__classPrivateFieldGet(this, _ContextProviderController_host, "f").addController(this);
|
|
21
|
+
}
|
|
22
|
+
provide(key, value) {
|
|
23
|
+
__classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").add(key, value);
|
|
24
|
+
}
|
|
25
|
+
hostConnected() {
|
|
26
|
+
__classPrivateFieldGet(this, _ContextProviderController_host, "f").addEventListener(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, __classPrivateFieldGet(this, _ContextProviderController_handleRequestedValue, "f"));
|
|
27
|
+
}
|
|
28
|
+
hostDisconnected() {
|
|
29
|
+
__classPrivateFieldGet(this, _ContextProviderController_host, "f").removeEventListener(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, __classPrivateFieldGet(this, _ContextProviderController_handleRequestedValue, "f"));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
_ContextProviderController_host = new WeakMap(), _ContextProviderController_contextValues = new WeakMap(), _ContextProviderController_handleRequestedValue = new WeakMap();
|
|
33
|
+
|
|
34
|
+
export { ContextProviderController };
|
|
35
|
+
//# sourceMappingURL=context_provider_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,yCAA6C;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
17
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
23
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { __classPrivateFieldGet, __classPrivateFieldSet };
|
|
30
|
+
//# sourceMappingURL=tslib.es6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { ValuesContainerError } from './values_container_error.js';
|
|
3
|
+
|
|
4
|
+
var _ValuesContainer_valuesContainer, _ValuesContainer_settings;
|
|
5
|
+
class ValuesContainer {
|
|
6
|
+
constructor(settings = {}) {
|
|
7
|
+
_ValuesContainer_valuesContainer.set(this, {});
|
|
8
|
+
_ValuesContainer_settings.set(this, {
|
|
9
|
+
silentMode: true,
|
|
10
|
+
allowOverwrite: false
|
|
11
|
+
});
|
|
12
|
+
__classPrivateFieldSet(this, _ValuesContainer_settings, {
|
|
13
|
+
...__classPrivateFieldGet(this, _ValuesContainer_settings, "f"),
|
|
14
|
+
...settings
|
|
15
|
+
}, "f");
|
|
16
|
+
}
|
|
17
|
+
add(key, value) {
|
|
18
|
+
if (this.has(key) && !__classPrivateFieldGet(this, _ValuesContainer_settings, "f").allowOverwrite)
|
|
19
|
+
this._handleError(new ValuesContainerError(`value under key [${key}] already exists`));
|
|
20
|
+
__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key] = value;
|
|
21
|
+
}
|
|
22
|
+
update(key, value) {
|
|
23
|
+
if (!this.has(key))
|
|
24
|
+
this._handleError(new ValuesContainerError(`value under key [${key}] doesn't exist`));
|
|
25
|
+
__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key] = value;
|
|
26
|
+
}
|
|
27
|
+
remove(key) {
|
|
28
|
+
if (!this.has(key))
|
|
29
|
+
this._handleError(new ValuesContainerError(`${key} doesn't exist, cannot be removed`));
|
|
30
|
+
delete __classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key];
|
|
31
|
+
}
|
|
32
|
+
has(key) {
|
|
33
|
+
return this.get(key) !== undefined;
|
|
34
|
+
}
|
|
35
|
+
get(key) {
|
|
36
|
+
return __classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key];
|
|
37
|
+
}
|
|
38
|
+
keys() {
|
|
39
|
+
return Object.keys(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
40
|
+
}
|
|
41
|
+
values() {
|
|
42
|
+
return Object.values(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
43
|
+
}
|
|
44
|
+
entries() {
|
|
45
|
+
return Object.entries(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
46
|
+
}
|
|
47
|
+
clear() {
|
|
48
|
+
__classPrivateFieldSet(this, _ValuesContainer_valuesContainer, {}, "f");
|
|
49
|
+
}
|
|
50
|
+
size() {
|
|
51
|
+
return this.keys().length;
|
|
52
|
+
}
|
|
53
|
+
_handleError(error) {
|
|
54
|
+
if (__classPrivateFieldGet(this, _ValuesContainer_settings, "f").silentMode)
|
|
55
|
+
return;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
_ValuesContainer_valuesContainer = new WeakMap(), _ValuesContainer_settings = new WeakMap();
|
|
60
|
+
|
|
61
|
+
export { ValuesContainer };
|
|
62
|
+
//# sourceMappingURL=values_container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __classPrivateFieldSet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
|
|
3
|
+
var _AppError_message, _AppError_options;
|
|
4
|
+
class AppError extends Error {
|
|
5
|
+
constructor(message, options = {}) {
|
|
6
|
+
super(message);
|
|
7
|
+
_AppError_message.set(this, void 0);
|
|
8
|
+
_AppError_options.set(this, void 0);
|
|
9
|
+
__classPrivateFieldSet(this, _AppError_message, message, "f");
|
|
10
|
+
__classPrivateFieldSet(this, _AppError_options, options, "f");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
_AppError_message = new WeakMap(), _AppError_options = new WeakMap();
|
|
14
|
+
|
|
15
|
+
export { AppError };
|
|
16
|
+
//# sourceMappingURL=app_error.js.map
|
package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|