@rebilly/instruments 3.39.3 → 3.39.4
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/CHANGELOG.md +7 -0
- package/dist/index.js +2 -2
- package/dist/index.min.js +2 -2
- package/package.json +1 -1
- package/src/functions/mount/index.js +8 -6
- package/src/functions/mount/setup-element.js +4 -1
- package/src/functions/mount/setup-framepay-theme.js +2 -4
- package/src/functions/mount/setup-storefront.js +4 -4
- package/src/functions/mount/setup-styles-vars.js +5 -4
package/package.json
CHANGED
|
@@ -23,9 +23,12 @@ export async function mount({
|
|
|
23
23
|
state.data = {};
|
|
24
24
|
state.options = {};
|
|
25
25
|
|
|
26
|
+
// Setup options
|
|
27
|
+
state.options = setupOptions({ options });
|
|
28
|
+
|
|
26
29
|
// Setup DOM
|
|
27
|
-
state.form = setupElement({ element: 'form'
|
|
28
|
-
state.summary = setupElement({ element: 'summary'
|
|
30
|
+
state.form = setupElement({ element: 'form' });
|
|
31
|
+
state.summary = setupElement({ element: 'summary' });
|
|
29
32
|
// hardcode max-width to not break UX
|
|
30
33
|
// PayPal button cannot exceed 750px;
|
|
31
34
|
state.form.style.maxWidth = '750px';
|
|
@@ -34,10 +37,9 @@ export async function mount({
|
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
// Setup state
|
|
37
|
-
state.
|
|
38
|
-
state.
|
|
39
|
-
state.
|
|
40
|
-
state.options.themeFramepay = setupFramepayTheme({ options });
|
|
40
|
+
state.storefront = setupStorefront();
|
|
41
|
+
state.mainStyleVars = setupStylesVars();
|
|
42
|
+
state.options.themeFramepay = setupFramepayTheme();
|
|
41
43
|
|
|
42
44
|
// Setup loader
|
|
43
45
|
state.loader.addDOMElement({ el: state.form });
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { processPropertyAsDOMElement } from '../../utils';
|
|
2
|
+
import state from '../../state';
|
|
2
3
|
|
|
3
|
-
export default ({element = ''
|
|
4
|
+
export default ({element = ''}) => {
|
|
5
|
+
const {options} = state;
|
|
6
|
+
|
|
4
7
|
if (element !== 'form' && element !== 'summary') {
|
|
5
8
|
throw new Error('element must be "form" or "summary"');
|
|
6
9
|
}
|
|
@@ -45,12 +45,10 @@ const getStyleProps = (obj, particle = '') => {
|
|
|
45
45
|
return output;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export default ({
|
|
49
|
-
options = {}
|
|
50
|
-
}) => {
|
|
48
|
+
export default () => {
|
|
51
49
|
const fullCss = `
|
|
52
50
|
${state.mainStyleVars}
|
|
53
|
-
${options
|
|
51
|
+
${state.options?.css || ''}
|
|
54
52
|
`;
|
|
55
53
|
|
|
56
54
|
const resolvedCssVarsObj = replaceCssVars(fullCss);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Storefront from '../../storefront';
|
|
2
|
+
import state from '../../state';
|
|
2
3
|
|
|
3
|
-
export default ({
|
|
4
|
-
|
|
4
|
+
export default () => {
|
|
5
|
+
const {
|
|
5
6
|
publishableKey,
|
|
6
7
|
organizationId,
|
|
7
8
|
apiMode,
|
|
8
9
|
_dev
|
|
9
|
-
}
|
|
10
|
-
}) => {
|
|
10
|
+
} = state.options;
|
|
11
11
|
|
|
12
12
|
const storefront = {
|
|
13
13
|
organizationId,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { mainStyleVars } from '../../style';
|
|
2
2
|
import { addDOMElement } from '../../utils';
|
|
3
3
|
import { minifyCss } from '../../style/utils/minifyCss';
|
|
4
|
+
import state from '../../state';
|
|
4
5
|
|
|
5
|
-
export default ({
|
|
6
|
-
|
|
6
|
+
export default () => {
|
|
7
|
+
const {
|
|
7
8
|
theme = {},
|
|
8
9
|
css,
|
|
9
|
-
}
|
|
10
|
-
|
|
10
|
+
} = state.options;
|
|
11
|
+
|
|
11
12
|
// Adds base CSS vars stylesheet
|
|
12
13
|
const styleVars = mainStyleVars(theme || {});
|
|
13
14
|
|