@shoper/phoenix_design_system 1.18.11-7 → 1.18.11-8
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/cjs/packages/phoenix/src/components/accordion/accordion_content.js +4 -4
- package/build/cjs/packages/phoenix/src/utilities/feature_flag_utils.js +26 -0
- package/build/cjs/packages/phoenix/src/utilities/feature_flag_utils.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/accordion/accordion_content.js +1 -1
- package/build/esm/packages/phoenix/src/utilities/feature_flag_utils.d.ts +6 -0
- package/build/esm/packages/phoenix/src/utilities/feature_flag_utils.js +22 -0
- package/build/esm/packages/phoenix/src/utilities/feature_flag_utils.js.map +1 -0
- package/package.json +2 -2
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
6
|
require('lit');
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
8
|
-
var utilities = require('@dreamcommerce/utilities');
|
|
9
8
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
10
9
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
11
10
|
var observer = require('../../core/classes/observer/observer.js');
|
|
12
11
|
var context_consumer_controller = require('../../core/context/context_consumer_controller.js');
|
|
13
12
|
var accordion_constants = require('./accordion_constants.js');
|
|
14
13
|
var transition_controller = require('../../controllers/transition_controller/transition_controller.js');
|
|
14
|
+
var feature_flag_utils = require('../../utilities/feature_flag_utils.js');
|
|
15
15
|
|
|
16
16
|
const RESIZE_DEBOUNCE_MS = 150;
|
|
17
17
|
const MUTATION_DEBOUNCE_MS = 100;
|
|
@@ -49,7 +49,7 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
49
49
|
window.clearTimeout(this._mutationDebounceTimer);
|
|
50
50
|
}
|
|
51
51
|
this._mutationDebounceTimer = window.setTimeout(() => {
|
|
52
|
-
if (
|
|
52
|
+
if (feature_flag_utils.FeatureFlagUtils.isEnabled('dev_accordion_height_fix')) {
|
|
53
53
|
this._forceHeightRecalculation();
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
@@ -105,7 +105,7 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
105
105
|
this._subscribeObserver();
|
|
106
106
|
window.addEventListener('resize', this._handleResize, { passive: true });
|
|
107
107
|
this.addEventListener('transitionend', this._boundHandleTransitionEnd);
|
|
108
|
-
if (
|
|
108
|
+
if (feature_flag_utils.FeatureFlagUtils.isEnabled('dev_accordion_height_fix')) {
|
|
109
109
|
this._setupImageLoadListeners();
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -161,7 +161,7 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
|
|
|
161
161
|
super.disconnectedCallback();
|
|
162
162
|
(_a = this._accordionGroupProps) === null || _a === void 0 ? void 0 : _a.unsubscribe(this._accordionGroupPropsObserver);
|
|
163
163
|
(_b = this._mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
164
|
-
if (
|
|
164
|
+
if (feature_flag_utils.FeatureFlagUtils.isEnabled('dev_accordion_height_fix')) {
|
|
165
165
|
const images = this.querySelectorAll('img');
|
|
166
166
|
images.forEach((img) => {
|
|
167
167
|
img.removeEventListener('load', this._boundHandleImageLoad);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
6
|
+
|
|
7
|
+
class FeatureFlagUtils {
|
|
8
|
+
static _initialize() {
|
|
9
|
+
if (this._flags !== null)
|
|
10
|
+
return;
|
|
11
|
+
const $script = document.getElementById('featureFlags');
|
|
12
|
+
this._flags = $script ? this._toObjectFromJsonScriptTag($script) : null;
|
|
13
|
+
}
|
|
14
|
+
static _toObjectFromJsonScriptTag(scriptTag) {
|
|
15
|
+
const scriptContent = scriptTag.textContent;
|
|
16
|
+
return utilities.JsonUtils.fromJson(scriptContent) || {};
|
|
17
|
+
}
|
|
18
|
+
static isEnabled(flagName) {
|
|
19
|
+
this._initialize();
|
|
20
|
+
return this._flags ? !!this._flags[flagName] : false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
FeatureFlagUtils._flags = null;
|
|
24
|
+
|
|
25
|
+
exports.FeatureFlagUtils = FeatureFlagUtils;
|
|
26
|
+
//# sourceMappingURL=feature_flag_utils.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;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import 'lit';
|
|
3
3
|
import { property } from 'lit/decorators';
|
|
4
|
-
import { FeatureFlagUtils } from '@dreamcommerce/utilities';
|
|
5
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
6
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
7
6
|
import { Observer } from '../../core/classes/observer/observer.js';
|
|
8
7
|
import { ContextConsumerController } from '../../core/context/context_consumer_controller.js';
|
|
9
8
|
import { ACCORDION_CONTEXTS } from './accordion_constants.js';
|
|
10
9
|
import { TransitionController } from '../../controllers/transition_controller/transition_controller.js';
|
|
10
|
+
import { FeatureFlagUtils } from '../../utilities/feature_flag_utils.js';
|
|
11
11
|
|
|
12
12
|
const RESIZE_DEBOUNCE_MS = 150;
|
|
13
13
|
const MUTATION_DEBOUNCE_MS = 100;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonUtils } from '@dreamcommerce/utilities';
|
|
2
|
+
|
|
3
|
+
class FeatureFlagUtils {
|
|
4
|
+
static _initialize() {
|
|
5
|
+
if (this._flags !== null)
|
|
6
|
+
return;
|
|
7
|
+
const $script = document.getElementById('featureFlags');
|
|
8
|
+
this._flags = $script ? this._toObjectFromJsonScriptTag($script) : null;
|
|
9
|
+
}
|
|
10
|
+
static _toObjectFromJsonScriptTag(scriptTag) {
|
|
11
|
+
const scriptContent = scriptTag.textContent;
|
|
12
|
+
return JsonUtils.fromJson(scriptContent) || {};
|
|
13
|
+
}
|
|
14
|
+
static isEnabled(flagName) {
|
|
15
|
+
this._initialize();
|
|
16
|
+
return this._flags ? !!this._flags[flagName] : false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
FeatureFlagUtils._flags = null;
|
|
20
|
+
|
|
21
|
+
export { FeatureFlagUtils };
|
|
22
|
+
//# sourceMappingURL=feature_flag_utils.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;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@shoper/phoenix_design_system",
|
|
3
3
|
"packageManager": "yarn@3.2.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "1.18.11-
|
|
5
|
+
"version": "1.18.11-8",
|
|
6
6
|
"description": "phoenix design system",
|
|
7
7
|
"author": "zefirek",
|
|
8
8
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@splidejs/splide-extension-auto-scroll": "0.5.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@dreamcommerce/utilities": "^1.23.2
|
|
34
|
+
"@dreamcommerce/utilities": "^1.23.2",
|
|
35
35
|
"@shoper/jest_config": "^0.0.0",
|
|
36
36
|
"@shoper/tsconfig": "^0.0.0",
|
|
37
37
|
"@splidejs/splide": "4.0.7",
|