publ-echo-test 0.0.319 → 0.0.320

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.
@@ -105,115 +105,95 @@ var Resizable = function (_a) {
105
105
  minWidth.current = Math.round(minWidthPx);
106
106
  }
107
107
  }, [isResizing, autoResize, children, elementRef]);
108
- // useEffect(() => {
109
- // if (!autoResize) {
110
- // return;
111
- // }
112
- // if (!isResizing) {
113
- // extendedHeightRef.current = null;
114
- // minWidth.current = 0;
115
- // shouldShrinkRef.current = false;
116
- // minHeight.current = 0;
117
- // return;
118
- // }
119
- // if (!elementRef.current) {
120
- // return;
121
- // }
122
- // setTimeout(() => {
123
- // const placeholder = document.querySelector(".placeholder");
124
- // if (!placeholder) {
125
- // return;
126
- // }
127
- // const target =
128
- // placeholder.children[0].children[0].children[0] ??
129
- // placeholder.children[0].children[0];
130
- // // const oneComposition = target.querySelector(".composition-container");
131
- // const isCCBLayoutbox = target.classList.contains("ccb-layout-box");
132
- // const layoutBox = target.children[0];
133
- // const contentsWrapper = layoutBox.children[0];
134
- // const oneComposition = contentsWrapper.querySelector(
135
- // ".composition-container"
136
- // );
137
- // // const oneComposition =
138
- // // contentsWrapper.children[0].children[0].children[0].children[2];
139
- // if (!isCCBLayoutbox || !oneComposition) {
140
- // return;
141
- // }
142
- // if (isCCBLayoutbox && oneComposition) {
143
- // const minCellWidth = 10;
144
- // const numberOfItems = Number(
145
- // target.getAttribute("data-number-of-items")!
146
- // );
147
- // const numberOfColumns = Number(
148
- // target.getAttribute("data-number-of-columns")!
149
- // );
150
- // const rowGap = Number(target.getAttribute("data-row-gap")!);
151
- // const columnGap = Number(target.getAttribute("data-column-gap")!);
152
- // const insetTop = Number(target.getAttribute("data-inset-top")!);
153
- // const insetBottom = Number(target.getAttribute("data-inset-bottom")!);
154
- // const compositionCols = Number(
155
- // oneComposition.getAttribute("data-cols")!
156
- // );
157
- // // const compositionRows = Number(
158
- // // oneComposition.getAttribute("data-rows")!
159
- // // );
160
- // const oneCompositionMinWidth =
161
- // minCellWidth * compositionCols + 20; /* 20px padding */
162
- // // let oneCompositionMinHeight =
163
- // // minColHeight * compositionRows + 20; /* 20px padding */
164
- // // const contentsWrapper = placeholder.querySelector(
165
- // // ".cb-contentslist-wrapper"
166
- // // );
167
- // if (contentsWrapper) {
168
- // const gridWrapperInnerH = contentsWrapper.clientHeight;
169
- // const oneCompositionH = oneComposition.clientHeight;
170
- // const compositionBGwrapperPaddingT = Number(
171
- // oneComposition.getAttribute("data-wrapper-paddingt")
172
- // );
173
- // const compositionBGwrapperPaddingB = Number(
174
- // oneComposition.getAttribute("data-wrapper-paddingb")
175
- // );
176
- // const compositionBGwrapperPaddingL = Number(
177
- // oneComposition.getAttribute("data-wrapper-paddingl")
178
- // );
179
- // const compositionBGwrapperPaddingR = Number(
180
- // oneComposition.getAttribute("data-wrapper-paddingr")
181
- // );
182
- // const oneCompositionMinHeight =
183
- // oneCompositionH +
184
- // compositionBGwrapperPaddingT +
185
- // compositionBGwrapperPaddingB;
186
- // const styles = getComputedStyle(target as Element);
187
- // const paddingL = parseFloat(styles.paddingLeft);
188
- // const paddingR = parseFloat(styles.paddingRight);
189
- // const paddingT = parseFloat(styles.paddingTop);
190
- // const paddingB = parseFloat(styles.paddingBottom);
191
- // const paddingLR = paddingL + paddingR;
192
- // const paddingTB = paddingT + paddingB;
193
- // const compositionWrapperPaddingLR =
194
- // (compositionBGwrapperPaddingL + compositionBGwrapperPaddingR) *
195
- // numberOfColumns;
196
- // const listMinWidth =
197
- // oneCompositionMinWidth * numberOfColumns +
198
- // (numberOfColumns - 1) * columnGap +
199
- // paddingLR +
200
- // compositionWrapperPaddingLR;
201
- // const numberOfRows = Math.ceil(numberOfItems / numberOfColumns);
202
- // const gridWrapperTotalH = gridWrapperInnerH + insetTop + insetBottom;
203
- // const listMinHeight =
204
- // oneCompositionMinHeight * numberOfRows +
205
- // (numberOfRows - 1) * rowGap +
206
- // paddingTB +
207
- // insetTop +
208
- // insetBottom;
209
- // if (listMinHeight > gridWrapperTotalH) {
210
- // minHeight.current = listMinHeight;
211
- // }
212
- // minWidth.current = listMinWidth;
213
- // }
214
- // }
215
- // }, 0);
216
- // }, [isResizing, autoResize, children, elementRef]);
108
+ useEffect(function () {
109
+ if (!autoResize) {
110
+ return;
111
+ }
112
+ if (!isResizing) {
113
+ extendedHeightRef.current = null;
114
+ minWidth.current = 0;
115
+ shouldShrinkRef.current = false;
116
+ minHeight.current = 0;
117
+ return;
118
+ }
119
+ if (!elementRef.current) {
120
+ return;
121
+ }
122
+ setTimeout(function () {
123
+ var _a;
124
+ var placeholder = document.querySelector(".placeholder");
125
+ if (!placeholder) {
126
+ return;
127
+ }
128
+ var target = (_a = placeholder.children[0].children[0].children[0]) !== null && _a !== void 0 ? _a : placeholder.children[0].children[0];
129
+ // const oneComposition = target.querySelector(".composition-container");
130
+ var isCCBLayoutbox = target.classList.contains("ccb-layout-box");
131
+ var layoutBox = target.children[0];
132
+ var contentsWrapper = layoutBox.children[0];
133
+ var oneComposition = contentsWrapper.querySelector(".composition-container");
134
+ // const oneComposition =
135
+ // contentsWrapper.children[0].children[0].children[0].children[2];
136
+ if (!isCCBLayoutbox || !oneComposition) {
137
+ return;
138
+ }
139
+ if (isCCBLayoutbox && oneComposition) {
140
+ var minCellWidth = 10;
141
+ var numberOfItems = Number(target.getAttribute("data-number-of-items"));
142
+ var numberOfColumns = Number(target.getAttribute("data-number-of-columns"));
143
+ var rowGap = Number(target.getAttribute("data-row-gap"));
144
+ var columnGap = Number(target.getAttribute("data-column-gap"));
145
+ var insetTop = Number(target.getAttribute("data-inset-top"));
146
+ var insetBottom = Number(target.getAttribute("data-inset-bottom"));
147
+ var compositionCols = Number(oneComposition.getAttribute("data-cols"));
148
+ // const compositionRows = Number(
149
+ // oneComposition.getAttribute("data-rows")!
150
+ // );
151
+ var oneCompositionMinWidth = minCellWidth * compositionCols + 20; /* 20px padding */
152
+ // let oneCompositionMinHeight =
153
+ // minColHeight * compositionRows + 20; /* 20px padding */
154
+ // const contentsWrapper = placeholder.querySelector(
155
+ // ".cb-contentslist-wrapper"
156
+ // );
157
+ if (contentsWrapper) {
158
+ var gridWrapperInnerH = contentsWrapper.clientHeight;
159
+ var oneCompositionH = oneComposition.clientHeight;
160
+ var compositionBGwrapperPaddingT = Number(oneComposition.getAttribute("data-wrapper-paddingt"));
161
+ var compositionBGwrapperPaddingB = Number(oneComposition.getAttribute("data-wrapper-paddingb"));
162
+ var compositionBGwrapperPaddingL = Number(oneComposition.getAttribute("data-wrapper-paddingl"));
163
+ var compositionBGwrapperPaddingR = Number(oneComposition.getAttribute("data-wrapper-paddingr"));
164
+ console.log("oneComposition", oneComposition);
165
+ console.log("onecompositionminheight", oneCompositionH);
166
+ var oneCompositionMinHeight = oneCompositionH +
167
+ compositionBGwrapperPaddingT +
168
+ compositionBGwrapperPaddingB;
169
+ var styles = getComputedStyle(target);
170
+ var paddingL = parseFloat(styles.paddingLeft);
171
+ var paddingR = parseFloat(styles.paddingRight);
172
+ var paddingT = parseFloat(styles.paddingTop);
173
+ var paddingB = parseFloat(styles.paddingBottom);
174
+ var paddingLR = paddingL + paddingR;
175
+ var paddingTB = paddingT + paddingB;
176
+ var compositionWrapperPaddingLR = (compositionBGwrapperPaddingL + compositionBGwrapperPaddingR) *
177
+ numberOfColumns;
178
+ var listMinWidth = oneCompositionMinWidth * numberOfColumns +
179
+ (numberOfColumns - 1) * columnGap +
180
+ paddingLR +
181
+ compositionWrapperPaddingLR;
182
+ var numberOfRows = Math.ceil(numberOfItems / numberOfColumns);
183
+ var gridWrapperTotalH = gridWrapperInnerH + insetTop + insetBottom;
184
+ var listMinHeight = oneCompositionMinHeight * numberOfRows +
185
+ (numberOfRows - 1) * rowGap +
186
+ paddingTB +
187
+ insetTop +
188
+ insetBottom;
189
+ if (listMinHeight > gridWrapperTotalH) {
190
+ minHeight.current = listMinHeight;
191
+ }
192
+ minWidth.current = listMinWidth;
193
+ }
194
+ }
195
+ }, 0);
196
+ }, [isResizing, autoResize, children, elementRef]);
217
197
  var resetData = function () {
218
198
  lastHandleRectRef.current = null;
219
199
  slack.current = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.319",
3
+ "version": "0.0.320",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",