itmar-block-packages 3.0.4 → 3.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/README.md +138 -0
- package/build/cjs/AnimationBlock.js +38 -47
- package/build/cjs/AnimationBlock.js.map +1 -1
- package/build/cjs/BlockEditWrapper.js +2 -2
- package/build/cjs/BlockEditWrapper.js.map +1 -1
- package/build/cjs/BlockPlace.js +111 -190
- package/build/cjs/BlockPlace.js.map +1 -1
- package/build/cjs/DateElm.js +41 -48
- package/build/cjs/DateElm.js.map +1 -1
- package/build/cjs/DraggableBox.js +3 -8
- package/build/cjs/DraggableBox.js.map +1 -1
- package/build/cjs/GridControls.js +52 -67
- package/build/cjs/GridControls.js.map +1 -1
- package/build/cjs/IconSelectControl.js +33 -47
- package/build/cjs/IconSelectControl.js.map +1 -1
- package/build/cjs/MasonryControl.js.map +1 -1
- package/build/cjs/PseudoElm.js +2 -2
- package/build/cjs/PseudoElm.js.map +1 -1
- package/build/cjs/ShadowStyle.js +35 -63
- package/build/cjs/ShadowStyle.js.map +1 -1
- package/build/cjs/SwiperControl.js +2 -2
- package/build/cjs/SwiperControl.js.map +1 -1
- package/build/cjs/ToggleElement.js +3 -3
- package/build/cjs/ToggleElement.js.map +1 -1
- package/build/cjs/TypographyControls.js +27 -35
- package/build/cjs/TypographyControls.js.map +1 -1
- package/build/cjs/UpdateAllPostsBlockAttributes.js +14 -20
- package/build/cjs/UpdateAllPostsBlockAttributes.js.map +1 -1
- package/build/cjs/blockStore.js.map +1 -1
- package/build/cjs/customHooks.js +20 -3
- package/build/cjs/customHooks.js.map +1 -1
- package/build/cjs/formatCreate.js +16 -22
- package/build/cjs/formatCreate.js.map +1 -1
- package/build/cjs/index.js +3 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/mediaUpload.js +10 -20
- package/build/cjs/mediaUpload.js.map +1 -1
- package/build/cjs/styleComponentApply.js +42 -0
- package/build/cjs/styleComponentApply.js.map +1 -0
- package/build/cjs/types/AnimationBlock.d.ts +1 -1
- package/build/cjs/types/BlockEditWrapper.d.ts +1 -1
- package/build/cjs/types/BlockPlace.d.ts +3 -3
- package/build/cjs/types/DateElm.d.ts +1 -1
- package/build/cjs/types/DraggableBox.d.ts +1 -1
- package/build/cjs/types/GridControls.d.ts +1 -1
- package/build/cjs/types/IconSelectControl.d.ts +1 -1
- package/build/cjs/types/PseudoElm.d.ts +1 -1
- package/build/cjs/types/ShadowStyle.d.ts +1 -1
- package/build/cjs/types/ToggleElement.d.ts +1 -1
- package/build/cjs/types/TypographyControls.d.ts +1 -1
- package/build/cjs/types/UpdateAllPostsBlockAttributes.d.ts +1 -1
- package/build/cjs/types/blockStore.d.ts +8 -6
- package/build/cjs/types/customHooks.d.ts +14 -7
- package/build/cjs/types/formatCreate.d.ts +1 -1
- package/build/cjs/types/index.d.ts +3 -2
- package/build/cjs/types/mediaUpload.d.ts +2 -2
- package/build/cjs/types/styleComponentApply.d.ts +4 -0
- package/build/cjs/types/wordpressApi.d.ts +6 -6
- package/build/cjs/wordpressApi.js +112 -139
- package/build/cjs/wordpressApi.js.map +1 -1
- package/build/esm/AnimationBlock.js +38 -47
- package/build/esm/AnimationBlock.js.map +1 -1
- package/build/esm/BlockEditWrapper.js +3 -3
- package/build/esm/BlockEditWrapper.js.map +1 -1
- package/build/esm/BlockPlace.js +111 -190
- package/build/esm/BlockPlace.js.map +1 -1
- package/build/esm/DateElm.js +39 -46
- package/build/esm/DateElm.js.map +1 -1
- package/build/esm/DraggableBox.js +3 -8
- package/build/esm/DraggableBox.js.map +1 -1
- package/build/esm/GridControls.js +52 -67
- package/build/esm/GridControls.js.map +1 -1
- package/build/esm/IconSelectControl.js +34 -48
- package/build/esm/IconSelectControl.js.map +1 -1
- package/build/esm/MasonryControl.js.map +1 -1
- package/build/esm/PseudoElm.js +2 -2
- package/build/esm/PseudoElm.js.map +1 -1
- package/build/esm/ShadowStyle.js +35 -63
- package/build/esm/ShadowStyle.js.map +1 -1
- package/build/esm/SwiperControl.js +1 -1
- package/build/esm/ToggleElement.js +3 -3
- package/build/esm/ToggleElement.js.map +1 -1
- package/build/esm/TypographyControls.js +27 -35
- package/build/esm/TypographyControls.js.map +1 -1
- package/build/esm/UpdateAllPostsBlockAttributes.js +15 -21
- package/build/esm/UpdateAllPostsBlockAttributes.js.map +1 -1
- package/build/esm/blockStore.js.map +1 -1
- package/build/esm/customHooks.js +21 -5
- package/build/esm/customHooks.js.map +1 -1
- package/build/esm/formatCreate.js +16 -22
- package/build/esm/formatCreate.js.map +1 -1
- package/build/esm/index.js +2 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/mediaUpload.js +10 -20
- package/build/esm/mediaUpload.js.map +1 -1
- package/build/esm/styleComponentApply.js +40 -0
- package/build/esm/styleComponentApply.js.map +1 -0
- package/build/esm/types/AnimationBlock.d.ts +1 -1
- package/build/esm/types/BlockEditWrapper.d.ts +1 -1
- package/build/esm/types/BlockPlace.d.ts +3 -3
- package/build/esm/types/DateElm.d.ts +1 -1
- package/build/esm/types/DraggableBox.d.ts +1 -1
- package/build/esm/types/GridControls.d.ts +1 -1
- package/build/esm/types/IconSelectControl.d.ts +1 -1
- package/build/esm/types/PseudoElm.d.ts +1 -1
- package/build/esm/types/ShadowStyle.d.ts +1 -1
- package/build/esm/types/ToggleElement.d.ts +1 -1
- package/build/esm/types/TypographyControls.d.ts +1 -1
- package/build/esm/types/UpdateAllPostsBlockAttributes.d.ts +1 -1
- package/build/esm/types/blockStore.d.ts +8 -6
- package/build/esm/types/customHooks.d.ts +14 -7
- package/build/esm/types/formatCreate.d.ts +1 -1
- package/build/esm/types/index.d.ts +3 -2
- package/build/esm/types/mediaUpload.d.ts +2 -2
- package/build/esm/types/styleComponentApply.d.ts +4 -0
- package/build/esm/types/wordpressApi.d.ts +6 -6
- package/build/esm/wordpressApi.js +113 -140
- package/build/esm/wordpressApi.js.map +1 -1
- package/package.json +12 -5
- package/build/cjs/node_modules/nanoid/non-secure/index.js +0 -15
- package/build/cjs/node_modules/nanoid/non-secure/index.js.map +0 -1
- package/build/cjs/node_modules/swiper/shared/ssr-window.esm.js +0 -144
- package/build/cjs/node_modules/swiper/shared/ssr-window.esm.js.map +0 -1
- package/build/cjs/node_modules/swiper/shared/swiper-core.js +0 -3925
- package/build/cjs/node_modules/swiper/shared/swiper-core.js.map +0 -1
- package/build/cjs/node_modules/swiper/shared/utils.js +0 -294
- package/build/cjs/node_modules/swiper/shared/utils.js.map +0 -1
- package/build/esm/AnimationBlock.d.ts +0 -22
- package/build/esm/BlockEditWrapper.d.ts +0 -7
- package/build/esm/BlockPlace.d.ts +0 -49
- package/build/esm/BrockInserter.d.ts +0 -6
- package/build/esm/DateElm.d.ts +0 -69
- package/build/esm/DraggableBox.d.ts +0 -19
- package/build/esm/GridControls.d.ts +0 -27
- package/build/esm/IconSelectControl.d.ts +0 -17
- package/build/esm/JapaneseHolidays.d.ts +0 -6
- package/build/esm/MasonryControl.d.ts +0 -35
- package/build/esm/PseudoElm.d.ts +0 -11
- package/build/esm/ShadowStyle.d.ts +0 -33
- package/build/esm/SwiperControl.d.ts +0 -12
- package/build/esm/ToggleElement.d.ts +0 -13
- package/build/esm/TypographyControls.d.ts +0 -17
- package/build/esm/UpdateAllPostsBlockAttributes.d.ts +0 -10
- package/build/esm/ZipAddress.d.ts +0 -18
- package/build/esm/blockStore.d.ts +0 -15
- package/build/esm/cssPropertes.d.ts +0 -53
- package/build/esm/customHooks.d.ts +0 -11
- package/build/esm/formatCreate.d.ts +0 -18
- package/build/esm/hslToRgb.d.ts +0 -23
- package/build/esm/index.d.ts +0 -27
- package/build/esm/mediaUpload.d.ts +0 -29
- package/build/esm/node_modules/nanoid/non-secure/index.js +0 -13
- package/build/esm/node_modules/nanoid/non-secure/index.js.map +0 -1
- package/build/esm/node_modules/swiper/shared/ssr-window.esm.js +0 -141
- package/build/esm/node_modules/swiper/shared/ssr-window.esm.js.map +0 -1
- package/build/esm/node_modules/swiper/shared/swiper-core.js +0 -3922
- package/build/esm/node_modules/swiper/shared/swiper-core.js.map +0 -1
- package/build/esm/node_modules/swiper/shared/utils.js +0 -274
- package/build/esm/node_modules/swiper/shared/utils.js.map +0 -1
- package/build/esm/pickupStore.d.ts +0 -39
- package/build/esm/shopfiApi.d.ts +0 -18
- package/build/esm/validationCheck.d.ts +0 -5
- package/build/esm/wordpressApi.d.ts +0 -99
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { a as getWindow } from './ssr-window.esm.js';
|
|
2
|
-
|
|
3
|
-
function classesToTokens(classes = '') {
|
|
4
|
-
return classes.trim().split(' ').filter(c => !!c.trim());
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function deleteProps(obj) {
|
|
8
|
-
const object = obj;
|
|
9
|
-
Object.keys(object).forEach(key => {
|
|
10
|
-
try {
|
|
11
|
-
object[key] = null;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
// no getter for object
|
|
14
|
-
}
|
|
15
|
-
try {
|
|
16
|
-
delete object[key];
|
|
17
|
-
} catch (e) {
|
|
18
|
-
// something got wrong
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function nextTick(callback, delay = 0) {
|
|
23
|
-
return setTimeout(callback, delay);
|
|
24
|
-
}
|
|
25
|
-
function now() {
|
|
26
|
-
return Date.now();
|
|
27
|
-
}
|
|
28
|
-
function getComputedStyle(el) {
|
|
29
|
-
const window = getWindow();
|
|
30
|
-
let style;
|
|
31
|
-
if (window.getComputedStyle) {
|
|
32
|
-
style = window.getComputedStyle(el, null);
|
|
33
|
-
}
|
|
34
|
-
if (!style && el.currentStyle) {
|
|
35
|
-
style = el.currentStyle;
|
|
36
|
-
}
|
|
37
|
-
if (!style) {
|
|
38
|
-
style = el.style;
|
|
39
|
-
}
|
|
40
|
-
return style;
|
|
41
|
-
}
|
|
42
|
-
function getTranslate(el, axis = 'x') {
|
|
43
|
-
const window = getWindow();
|
|
44
|
-
let matrix;
|
|
45
|
-
let curTransform;
|
|
46
|
-
let transformMatrix;
|
|
47
|
-
const curStyle = getComputedStyle(el);
|
|
48
|
-
if (window.WebKitCSSMatrix) {
|
|
49
|
-
curTransform = curStyle.transform || curStyle.webkitTransform;
|
|
50
|
-
if (curTransform.split(',').length > 6) {
|
|
51
|
-
curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
|
|
52
|
-
}
|
|
53
|
-
// Some old versions of Webkit choke when 'none' is passed; pass
|
|
54
|
-
// empty string instead in this case
|
|
55
|
-
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
|
56
|
-
} else {
|
|
57
|
-
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
|
58
|
-
matrix = transformMatrix.toString().split(',');
|
|
59
|
-
}
|
|
60
|
-
if (axis === 'x') {
|
|
61
|
-
// Latest Chrome and webkits Fix
|
|
62
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
|
|
63
|
-
// Crazy IE10 Matrix
|
|
64
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
|
|
65
|
-
// Normal Browsers
|
|
66
|
-
else curTransform = parseFloat(matrix[4]);
|
|
67
|
-
}
|
|
68
|
-
if (axis === 'y') {
|
|
69
|
-
// Latest Chrome and webkits Fix
|
|
70
|
-
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
|
|
71
|
-
// Crazy IE10 Matrix
|
|
72
|
-
else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
|
|
73
|
-
// Normal Browsers
|
|
74
|
-
else curTransform = parseFloat(matrix[5]);
|
|
75
|
-
}
|
|
76
|
-
return curTransform || 0;
|
|
77
|
-
}
|
|
78
|
-
function isObject(o) {
|
|
79
|
-
return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
|
|
80
|
-
}
|
|
81
|
-
function isNode(node) {
|
|
82
|
-
// eslint-disable-next-line
|
|
83
|
-
if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
|
|
84
|
-
return node instanceof HTMLElement;
|
|
85
|
-
}
|
|
86
|
-
return node && (node.nodeType === 1 || node.nodeType === 11);
|
|
87
|
-
}
|
|
88
|
-
function extend(...args) {
|
|
89
|
-
const to = Object(args[0]);
|
|
90
|
-
for (let i = 1; i < args.length; i += 1) {
|
|
91
|
-
const nextSource = args[i];
|
|
92
|
-
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
|
|
93
|
-
const keysArray = Object.keys(Object(nextSource)).filter(key => key !== '__proto__' && key !== 'constructor' && key !== 'prototype');
|
|
94
|
-
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
95
|
-
const nextKey = keysArray[nextIndex];
|
|
96
|
-
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
97
|
-
if (desc !== undefined && desc.enumerable) {
|
|
98
|
-
if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
99
|
-
if (nextSource[nextKey].__swiper__) {
|
|
100
|
-
to[nextKey] = nextSource[nextKey];
|
|
101
|
-
} else {
|
|
102
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
103
|
-
}
|
|
104
|
-
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
105
|
-
to[nextKey] = {};
|
|
106
|
-
if (nextSource[nextKey].__swiper__) {
|
|
107
|
-
to[nextKey] = nextSource[nextKey];
|
|
108
|
-
} else {
|
|
109
|
-
extend(to[nextKey], nextSource[nextKey]);
|
|
110
|
-
}
|
|
111
|
-
} else {
|
|
112
|
-
to[nextKey] = nextSource[nextKey];
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return to;
|
|
119
|
-
}
|
|
120
|
-
function setCSSProperty(el, varName, varValue) {
|
|
121
|
-
el.style.setProperty(varName, varValue);
|
|
122
|
-
}
|
|
123
|
-
function animateCSSModeScroll({
|
|
124
|
-
swiper,
|
|
125
|
-
targetPosition,
|
|
126
|
-
side
|
|
127
|
-
}) {
|
|
128
|
-
const window = getWindow();
|
|
129
|
-
const startPosition = -swiper.translate;
|
|
130
|
-
let startTime = null;
|
|
131
|
-
let time;
|
|
132
|
-
const duration = swiper.params.speed;
|
|
133
|
-
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
134
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
135
|
-
const dir = targetPosition > startPosition ? 'next' : 'prev';
|
|
136
|
-
const isOutOfBound = (current, target) => {
|
|
137
|
-
return dir === 'next' && current >= target || dir === 'prev' && current <= target;
|
|
138
|
-
};
|
|
139
|
-
const animate = () => {
|
|
140
|
-
time = new Date().getTime();
|
|
141
|
-
if (startTime === null) {
|
|
142
|
-
startTime = time;
|
|
143
|
-
}
|
|
144
|
-
const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
|
|
145
|
-
const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
|
|
146
|
-
let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
|
|
147
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
148
|
-
currentPosition = targetPosition;
|
|
149
|
-
}
|
|
150
|
-
swiper.wrapperEl.scrollTo({
|
|
151
|
-
[side]: currentPosition
|
|
152
|
-
});
|
|
153
|
-
if (isOutOfBound(currentPosition, targetPosition)) {
|
|
154
|
-
swiper.wrapperEl.style.overflow = 'hidden';
|
|
155
|
-
swiper.wrapperEl.style.scrollSnapType = '';
|
|
156
|
-
setTimeout(() => {
|
|
157
|
-
swiper.wrapperEl.style.overflow = '';
|
|
158
|
-
swiper.wrapperEl.scrollTo({
|
|
159
|
-
[side]: currentPosition
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
window.cancelAnimationFrame(swiper.cssModeFrameID);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
swiper.cssModeFrameID = window.requestAnimationFrame(animate);
|
|
166
|
-
};
|
|
167
|
-
animate();
|
|
168
|
-
}
|
|
169
|
-
function elementChildren(element, selector = '') {
|
|
170
|
-
const window = getWindow();
|
|
171
|
-
const children = [...element.children];
|
|
172
|
-
if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {
|
|
173
|
-
children.push(...element.assignedElements());
|
|
174
|
-
}
|
|
175
|
-
if (!selector) {
|
|
176
|
-
return children;
|
|
177
|
-
}
|
|
178
|
-
return children.filter(el => el.matches(selector));
|
|
179
|
-
}
|
|
180
|
-
function elementIsChildOfSlot(el, slot) {
|
|
181
|
-
// Breadth-first search through all parent's children and assigned elements
|
|
182
|
-
const elementsQueue = [slot];
|
|
183
|
-
while (elementsQueue.length > 0) {
|
|
184
|
-
const elementToCheck = elementsQueue.shift();
|
|
185
|
-
if (el === elementToCheck) {
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function elementIsChildOf(el, parent) {
|
|
192
|
-
const window = getWindow();
|
|
193
|
-
let isChild = parent.contains(el);
|
|
194
|
-
if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {
|
|
195
|
-
const children = [...parent.assignedElements()];
|
|
196
|
-
isChild = children.includes(el);
|
|
197
|
-
if (!isChild) {
|
|
198
|
-
isChild = elementIsChildOfSlot(el, parent);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return isChild;
|
|
202
|
-
}
|
|
203
|
-
function showWarning(text) {
|
|
204
|
-
try {
|
|
205
|
-
console.warn(text);
|
|
206
|
-
return;
|
|
207
|
-
} catch (err) {
|
|
208
|
-
// err
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
function createElement(tag, classes = []) {
|
|
212
|
-
const el = document.createElement(tag);
|
|
213
|
-
el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));
|
|
214
|
-
return el;
|
|
215
|
-
}
|
|
216
|
-
function elementPrevAll(el, selector) {
|
|
217
|
-
const prevEls = [];
|
|
218
|
-
while (el.previousElementSibling) {
|
|
219
|
-
const prev = el.previousElementSibling; // eslint-disable-line
|
|
220
|
-
if (selector) {
|
|
221
|
-
if (prev.matches(selector)) prevEls.push(prev);
|
|
222
|
-
} else prevEls.push(prev);
|
|
223
|
-
el = prev;
|
|
224
|
-
}
|
|
225
|
-
return prevEls;
|
|
226
|
-
}
|
|
227
|
-
function elementNextAll(el, selector) {
|
|
228
|
-
const nextEls = [];
|
|
229
|
-
while (el.nextElementSibling) {
|
|
230
|
-
const next = el.nextElementSibling; // eslint-disable-line
|
|
231
|
-
if (selector) {
|
|
232
|
-
if (next.matches(selector)) nextEls.push(next);
|
|
233
|
-
} else nextEls.push(next);
|
|
234
|
-
el = next;
|
|
235
|
-
}
|
|
236
|
-
return nextEls;
|
|
237
|
-
}
|
|
238
|
-
function elementStyle(el, prop) {
|
|
239
|
-
const window = getWindow();
|
|
240
|
-
return window.getComputedStyle(el, null).getPropertyValue(prop);
|
|
241
|
-
}
|
|
242
|
-
function elementIndex(el) {
|
|
243
|
-
let child = el;
|
|
244
|
-
let i;
|
|
245
|
-
if (child) {
|
|
246
|
-
i = 0;
|
|
247
|
-
// eslint-disable-next-line
|
|
248
|
-
while ((child = child.previousSibling) !== null) {
|
|
249
|
-
if (child.nodeType === 1) i += 1;
|
|
250
|
-
}
|
|
251
|
-
return i;
|
|
252
|
-
}
|
|
253
|
-
return undefined;
|
|
254
|
-
}
|
|
255
|
-
function elementParents(el, selector) {
|
|
256
|
-
const parents = []; // eslint-disable-line
|
|
257
|
-
let parent = el.parentElement; // eslint-disable-line
|
|
258
|
-
while (parent) {
|
|
259
|
-
{
|
|
260
|
-
parents.push(parent);
|
|
261
|
-
}
|
|
262
|
-
parent = parent.parentElement;
|
|
263
|
-
}
|
|
264
|
-
return parents;
|
|
265
|
-
}
|
|
266
|
-
function elementOuterSize(el, size, includeMargins) {
|
|
267
|
-
const window = getWindow();
|
|
268
|
-
{
|
|
269
|
-
return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export { setCSSProperty as b, createElement as c, elementParents as d, elementChildren as e, now as h, elementOuterSize as i, elementIndex as j, classesToTokens as k, getTranslate as l, nextTick as n, isObject as p, elementStyle as q, elementNextAll as r, elementPrevAll as t, animateCSSModeScroll as u, showWarning as v, elementIsChildOf as w, extend as x, deleteProps as y };
|
|
274
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../node_modules/swiper/shared/utils.mjs"],"sourcesContent":["import { a as getWindow, g as getDocument } from './ssr-window.esm.mjs';\n\nfunction classesToTokens(classes = '') {\n return classes.trim().split(' ').filter(c => !!c.trim());\n}\n\nfunction deleteProps(obj) {\n const object = obj;\n Object.keys(object).forEach(key => {\n try {\n object[key] = null;\n } catch (e) {\n // no getter for object\n }\n try {\n delete object[key];\n } catch (e) {\n // something got wrong\n }\n });\n}\nfunction nextTick(callback, delay = 0) {\n return setTimeout(callback, delay);\n}\nfunction now() {\n return Date.now();\n}\nfunction getComputedStyle(el) {\n const window = getWindow();\n let style;\n if (window.getComputedStyle) {\n style = window.getComputedStyle(el, null);\n }\n if (!style && el.currentStyle) {\n style = el.currentStyle;\n }\n if (!style) {\n style = el.style;\n }\n return style;\n}\nfunction getTranslate(el, axis = 'x') {\n const window = getWindow();\n let matrix;\n let curTransform;\n let transformMatrix;\n const curStyle = getComputedStyle(el);\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n return curTransform || 0;\n}\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';\n}\nfunction isNode(node) {\n // eslint-disable-next-line\n if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {\n return node instanceof HTMLElement;\n }\n return node && (node.nodeType === 1 || node.nodeType === 11);\n}\nfunction extend(...args) {\n const to = Object(args[0]);\n for (let i = 1; i < args.length; i += 1) {\n const nextSource = args[i];\n if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {\n const keysArray = Object.keys(Object(nextSource)).filter(key => key !== '__proto__' && key !== 'constructor' && key !== 'prototype');\n for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n const nextKey = keysArray[nextIndex];\n const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n return to;\n}\nfunction setCSSProperty(el, varName, varValue) {\n el.style.setProperty(varName, varValue);\n}\nfunction animateCSSModeScroll({\n swiper,\n targetPosition,\n side\n}) {\n const window = getWindow();\n const startPosition = -swiper.translate;\n let startTime = null;\n let time;\n const duration = swiper.params.speed;\n swiper.wrapperEl.style.scrollSnapType = 'none';\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n const dir = targetPosition > startPosition ? 'next' : 'prev';\n const isOutOfBound = (current, target) => {\n return dir === 'next' && current >= target || dir === 'prev' && current <= target;\n };\n const animate = () => {\n time = new Date().getTime();\n if (startTime === null) {\n startTime = time;\n }\n const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;\n let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);\n if (isOutOfBound(currentPosition, targetPosition)) {\n currentPosition = targetPosition;\n }\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n if (isOutOfBound(currentPosition, targetPosition)) {\n swiper.wrapperEl.style.overflow = 'hidden';\n swiper.wrapperEl.style.scrollSnapType = '';\n setTimeout(() => {\n swiper.wrapperEl.style.overflow = '';\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n });\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n return;\n }\n swiper.cssModeFrameID = window.requestAnimationFrame(animate);\n };\n animate();\n}\nfunction getSlideTransformEl(slideEl) {\n return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowRoot && slideEl.shadowRoot.querySelector('.swiper-slide-transform') || slideEl;\n}\nfunction elementChildren(element, selector = '') {\n const window = getWindow();\n const children = [...element.children];\n if (window.HTMLSlotElement && element instanceof HTMLSlotElement) {\n children.push(...element.assignedElements());\n }\n if (!selector) {\n return children;\n }\n return children.filter(el => el.matches(selector));\n}\nfunction elementIsChildOfSlot(el, slot) {\n // Breadth-first search through all parent's children and assigned elements\n const elementsQueue = [slot];\n while (elementsQueue.length > 0) {\n const elementToCheck = elementsQueue.shift();\n if (el === elementToCheck) {\n return true;\n }\n elementsQueue.push(...elementToCheck.children, ...(elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : []), ...(elementToCheck.assignedElements ? elementToCheck.assignedElements() : []));\n }\n}\nfunction elementIsChildOf(el, parent) {\n const window = getWindow();\n let isChild = parent.contains(el);\n if (!isChild && window.HTMLSlotElement && parent instanceof HTMLSlotElement) {\n const children = [...parent.assignedElements()];\n isChild = children.includes(el);\n if (!isChild) {\n isChild = elementIsChildOfSlot(el, parent);\n }\n }\n return isChild;\n}\nfunction showWarning(text) {\n try {\n console.warn(text);\n return;\n } catch (err) {\n // err\n }\n}\nfunction createElement(tag, classes = []) {\n const el = document.createElement(tag);\n el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));\n return el;\n}\nfunction elementOffset(el) {\n const window = getWindow();\n const document = getDocument();\n const box = el.getBoundingClientRect();\n const body = document.body;\n const clientTop = el.clientTop || body.clientTop || 0;\n const clientLeft = el.clientLeft || body.clientLeft || 0;\n const scrollTop = el === window ? window.scrollY : el.scrollTop;\n const scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: box.top + scrollTop - clientTop,\n left: box.left + scrollLeft - clientLeft\n };\n}\nfunction elementPrevAll(el, selector) {\n const prevEls = [];\n while (el.previousElementSibling) {\n const prev = el.previousElementSibling; // eslint-disable-line\n if (selector) {\n if (prev.matches(selector)) prevEls.push(prev);\n } else prevEls.push(prev);\n el = prev;\n }\n return prevEls;\n}\nfunction elementNextAll(el, selector) {\n const nextEls = [];\n while (el.nextElementSibling) {\n const next = el.nextElementSibling; // eslint-disable-line\n if (selector) {\n if (next.matches(selector)) nextEls.push(next);\n } else nextEls.push(next);\n el = next;\n }\n return nextEls;\n}\nfunction elementStyle(el, prop) {\n const window = getWindow();\n return window.getComputedStyle(el, null).getPropertyValue(prop);\n}\nfunction elementIndex(el) {\n let child = el;\n let i;\n if (child) {\n i = 0;\n // eslint-disable-next-line\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n return i;\n }\n return undefined;\n}\nfunction elementParents(el, selector) {\n const parents = []; // eslint-disable-line\n let parent = el.parentElement; // eslint-disable-line\n while (parent) {\n if (selector) {\n if (parent.matches(selector)) parents.push(parent);\n } else {\n parents.push(parent);\n }\n parent = parent.parentElement;\n }\n return parents;\n}\nfunction elementTransitionEnd(el, callback) {\n function fireCallBack(e) {\n if (e.target !== el) return;\n callback.call(el, e);\n el.removeEventListener('transitionend', fireCallBack);\n }\n if (callback) {\n el.addEventListener('transitionend', fireCallBack);\n }\n}\nfunction elementOuterSize(el, size, includeMargins) {\n const window = getWindow();\n if (includeMargins) {\n return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));\n }\n return el.offsetWidth;\n}\nfunction makeElementsArray(el) {\n return (Array.isArray(el) ? el : [el]).filter(e => !!e);\n}\nfunction getRotateFix(swiper) {\n return v => {\n if (Math.abs(v) > 0 && swiper.browser && swiper.browser.need3dFix && Math.abs(v) % 90 === 0) {\n return v + 0.001;\n }\n return v;\n };\n}\nfunction setInnerHTML(el, html = '') {\n if (typeof trustedTypes !== 'undefined') {\n el.innerHTML = trustedTypes.createPolicy('html', {\n createHTML: s => s\n }).createHTML(html);\n } else {\n el.innerHTML = html;\n }\n}\n\nexport { getRotateFix as a, setCSSProperty as b, createElement as c, elementParents as d, elementChildren as e, elementOffset as f, getSlideTransformEl as g, now as h, elementOuterSize as i, elementIndex as j, classesToTokens as k, getTranslate as l, makeElementsArray as m, nextTick as n, elementTransitionEnd as o, isObject as p, elementStyle as q, elementNextAll as r, setInnerHTML as s, elementPrevAll as t, animateCSSModeScroll as u, showWarning as v, elementIsChildOf as w, extend as x, deleteProps as y };\n"],"names":[],"mappings":";;AAEA,SAAS,eAAe,CAAC,OAAO,GAAG,EAAE,EAAE;AACvC,EAAE,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1D;;AAEA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,GAAG;AACpB,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI;AACrC,IAAI,IAAI;AACR,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI;AACxB,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAChB;AACA,IAAI;AACJ,IAAI,IAAI;AACR,MAAM,OAAO,MAAM,CAAC,GAAG,CAAC;AACxB,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAChB;AACA,IAAI;AACJ,EAAE,CAAC,CAAC;AACJ;AACA,SAAS,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE;AACvC,EAAE,OAAO,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC;AACpC;AACA,SAAS,GAAG,GAAG;AACf,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE;AACnB;AACA,SAAS,gBAAgB,CAAC,EAAE,EAAE;AAC9B,EAAE,MAAM,M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AAG,aAAa,GAAG,eAAe,CAAC,CAAC;AACxS,EAAE;AAEF;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
declare const GLOBAL_KEY = "__itmar_pickup_store__";
|
|
2
|
-
interface PickupState {
|
|
3
|
-
page: number;
|
|
4
|
-
searchKeyWord: string;
|
|
5
|
-
periodDisp: string;
|
|
6
|
-
periodQueryObj: Record<string, any>;
|
|
7
|
-
termParamObj: Record<string, any> | null;
|
|
8
|
-
termQueryObj: any[];
|
|
9
|
-
posts: any[];
|
|
10
|
-
rawPosts: any[] | null;
|
|
11
|
-
targetIndex: number;
|
|
12
|
-
total: number;
|
|
13
|
-
}
|
|
14
|
-
interface PickupContext {
|
|
15
|
-
id: string;
|
|
16
|
-
pickupEl: HTMLElement | null;
|
|
17
|
-
dataset: Record<string, string | undefined>;
|
|
18
|
-
state: PickupState;
|
|
19
|
-
listeners: Set<(ctx: PickupContext) => void>;
|
|
20
|
-
cache: {
|
|
21
|
-
taxonomies: any | null;
|
|
22
|
-
};
|
|
23
|
-
inflight: {
|
|
24
|
-
abort: AbortController | null;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
declare global {
|
|
28
|
-
interface Window {
|
|
29
|
-
[GLOBAL_KEY]: {
|
|
30
|
-
contexts: Map<string, PickupContext>;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export declare function ensureCtx(id: string | undefined): PickupContext | null;
|
|
35
|
-
export declare function registerPickup(pickupEl: HTMLElement | null): PickupContext | null;
|
|
36
|
-
export declare function getCtx(id: string): PickupContext | null;
|
|
37
|
-
export declare function subscribe(id: string, fn: (ctx: PickupContext) => void): () => void;
|
|
38
|
-
export declare function setState(id: string, partial: Partial<PickupState>): void;
|
|
39
|
-
export {};
|
package/build/esm/shopfiApi.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare function redirectCustomerAuthorize(shopId: string, clientId: string, userMail: string, callbackUri: string, // Shopify側の管理画面で登録したリダイレクト先
|
|
2
|
-
redirectUri: string): Promise<void>;
|
|
3
|
-
/**
|
|
4
|
-
* Shopifyの顧客トークンを検証し、ログイン状態を確認する
|
|
5
|
-
*/
|
|
6
|
-
export declare function checkCustomerLoginState(): Promise<boolean | void>;
|
|
7
|
-
/**
|
|
8
|
-
* 通信モードの定義
|
|
9
|
-
* auto: URLから自動判別
|
|
10
|
-
* rest: WP REST API形式 (application/json)
|
|
11
|
-
* admin: admin-ajax.php形式 (x-www-form-urlencoded)
|
|
12
|
-
*/
|
|
13
|
-
type ApiMode = "auto" | "rest" | "admin";
|
|
14
|
-
/**
|
|
15
|
-
* 統合された WordPress 通信関数
|
|
16
|
-
*/
|
|
17
|
-
export declare function sendRegistrationRequest<T = any>(urlOrPath: string, data?: Record<string, any>, mode?: ApiMode): Promise<T>;
|
|
18
|
-
export {};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
export declare const restFetchData: <T = any>(path: string) => Promise<T | undefined>;
|
|
2
|
-
interface SelectOption {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
slug: string;
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
interface SelectControlProps {
|
|
9
|
-
selectedSlug: string | undefined;
|
|
10
|
-
label: string;
|
|
11
|
-
homeUrl: string;
|
|
12
|
-
fetchOptions: (homeUrl: string, props: any) => Promise<SelectOption[]>;
|
|
13
|
-
onChange: (newInfo: SelectOption | undefined) => void;
|
|
14
|
-
restBase?: string;
|
|
15
|
-
status?: string;
|
|
16
|
-
perPage?: number;
|
|
17
|
-
orderby?: string;
|
|
18
|
-
order?: string;
|
|
19
|
-
search?: string;
|
|
20
|
-
}
|
|
21
|
-
interface ChoiceControlProps {
|
|
22
|
-
selectedSlug: string | undefined;
|
|
23
|
-
choiceItems: any[];
|
|
24
|
-
dispTaxonomies: string[];
|
|
25
|
-
type: "taxonomy" | "field" | "imgField";
|
|
26
|
-
blockMap: Record<string, string>;
|
|
27
|
-
textDomain?: string;
|
|
28
|
-
fetchFunction: (slug: string) => Promise<any[] | undefined>;
|
|
29
|
-
onChange: (items: any[]) => void;
|
|
30
|
-
onBlockMapChange: (map: Record<string, string>) => void;
|
|
31
|
-
onSetDispTax: (taxonomies: string[]) => void;
|
|
32
|
-
}
|
|
33
|
-
interface PageOption {
|
|
34
|
-
value: string;
|
|
35
|
-
slug: string;
|
|
36
|
-
label: string;
|
|
37
|
-
link: string;
|
|
38
|
-
}
|
|
39
|
-
export declare const fetchPagesOptions: (home_url: string) => Promise<PageOption[]>;
|
|
40
|
-
interface ArchiveOption {
|
|
41
|
-
value: string;
|
|
42
|
-
slug: string;
|
|
43
|
-
rest_base: string;
|
|
44
|
-
link: string;
|
|
45
|
-
label: string;
|
|
46
|
-
}
|
|
47
|
-
export declare const fetchArchiveOptions: (home_url: string) => Promise<ArchiveOption[]>;
|
|
48
|
-
interface PostOption {
|
|
49
|
-
value: string;
|
|
50
|
-
label: string;
|
|
51
|
-
slug: string;
|
|
52
|
-
link: string;
|
|
53
|
-
rest_base: string;
|
|
54
|
-
post_id: number;
|
|
55
|
-
}
|
|
56
|
-
interface TaxonomyObject {
|
|
57
|
-
slug: string;
|
|
58
|
-
name: string;
|
|
59
|
-
rest_base: string;
|
|
60
|
-
terms: any[];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 1. 投稿データ取得RestAPI関数
|
|
64
|
-
*/
|
|
65
|
-
export declare const fetchPostOptions: (home_url: string, props?: any) => Promise<PostOption[]>;
|
|
66
|
-
/**
|
|
67
|
-
* 2. タクソノミー取得RestAPI関数
|
|
68
|
-
*/
|
|
69
|
-
export declare const restTaxonomies: (post_type: string) => Promise<TaxonomyObject[] | undefined>;
|
|
70
|
-
export declare const termToDispObj: (terms: any[], connectString: string) => Record<string, string>;
|
|
71
|
-
/**
|
|
72
|
-
* 4. フィールド情報取得RestAPI関数
|
|
73
|
-
*/
|
|
74
|
-
export declare const restFieldes: (rest_base: string) => Promise<any[]>;
|
|
75
|
-
/**
|
|
76
|
-
* 固定ページ選択用
|
|
77
|
-
*/
|
|
78
|
-
export declare const PageSelectControl: (props: Omit<SelectControlProps, "fetchOptions">) => JSX.Element;
|
|
79
|
-
/**
|
|
80
|
-
* アーカイブ(投稿タイプ)選択用
|
|
81
|
-
*/
|
|
82
|
-
export declare const ArchiveSelectControl: (props: Omit<SelectControlProps, "fetchOptions">) => JSX.Element;
|
|
83
|
-
/**
|
|
84
|
-
* 投稿(各投稿タイプの中身)選択用
|
|
85
|
-
*/
|
|
86
|
-
export declare const PostSelectControl: (props: Omit<SelectControlProps, "fetchOptions">) => JSX.Element;
|
|
87
|
-
/**
|
|
88
|
-
* タクソノミー・ターム選択用
|
|
89
|
-
*/
|
|
90
|
-
export declare const TermChoiceControl: (props: Omit<ChoiceControlProps, "fetchFunction">) => JSX.Element;
|
|
91
|
-
/**
|
|
92
|
-
* カスタムフィールド(ACF/Meta)選択用
|
|
93
|
-
*/
|
|
94
|
-
export declare const FieldChoiceControl: (props: Omit<ChoiceControlProps, "fetchFunction" | "type">) => JSX.Element;
|
|
95
|
-
/**
|
|
96
|
-
* 画像系カスタムフィールド選択用
|
|
97
|
-
*/
|
|
98
|
-
export declare const ImageFieldChoiceControl: (props: Omit<ChoiceControlProps, "fetchFunction" | "type">) => JSX.Element;
|
|
99
|
-
export {};
|