@antscorp/antsomi-ui 1.3.5-beta.138 → 1.3.5-beta.139

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.
@@ -1,6 +1,6 @@
1
1
  // Libraries
2
2
  import React, { memo, useEffect, useLayoutEffect, useState } from 'react';
3
- import { get, isArray, isEqual, set } from 'lodash';
3
+ import { get, isArray, set } from 'lodash';
4
4
  // Locale
5
5
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
6
6
  import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
@@ -214,17 +214,20 @@ const Settings = (props) => {
214
214
  }, [isCDP, contentSourceDispatch, groups.length]);
215
215
  // init data
216
216
  useDeepCompareEffect(() => {
217
- if (initValue && !isEqual(initValue, contentSources)) {
217
+ if (initValue) {
218
218
  contentSourceDispatch(updateContentSourceSettings(initValue));
219
+ if (isCDP) {
220
+ setIsInitDataCDPDone(true);
221
+ }
219
222
  }
220
- }, [initValue, contentSources, contentSourceDispatch]);
223
+ }, [initValue, contentSourceDispatch, isCDP]);
221
224
  // callback data out
222
225
  useDeepCompareEffect(() => {
223
226
  if (typeof onChange === 'function') {
224
227
  onChange(contentSourcesDebounce);
225
228
  }
226
229
  }, [contentSourcesDebounce]);
227
- return (React.createElement(ContentContainer, null,
230
+ return (React.createElement(ContentContainer, { className: "contentsource-container" },
228
231
  React.createElement(Content, { isLoadingListBO: isLoadingListBO, listBO: listBO, groups: groups, expanded: expanded, onChangeExpand: expanded => {
229
232
  contentSourceDispatch({
230
233
  type: 'EXPANDED',
@@ -3,4 +3,4 @@ export { Menu } from './Menu';
3
3
  export { PositionSetting, PositionSettingPopover } from './PositionSetting';
4
4
  export { Table, ExplorePivotTable, EXPLORE_PIVOT_TABLE_TEST_DATA } from './Table';
5
5
  export { GenerativeInsights } from './GenerativeInsights';
6
- export * from './ContentSources';
6
+ export { default as ContentSources } from './ContentSources';
@@ -3,4 +3,4 @@ export { Menu } from './Menu';
3
3
  export { PositionSetting, PositionSettingPopover } from './PositionSetting';
4
4
  export { Table, ExplorePivotTable, EXPLORE_PIVOT_TABLE_TEST_DATA } from './Table';
5
5
  export { GenerativeInsights } from './GenerativeInsights';
6
- export * from './ContentSources';
6
+ export { default as ContentSources } from './ContentSources';
package/es/test.js CHANGED
@@ -2,9 +2,10 @@
2
2
  import React, { useState } from 'react';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import '@antscorp/icons/main.css';
5
- import { ConfigProvider, InputDynamic, } from './components';
5
+ import { ConfigProvider, InputDynamic, SettingWrapper, UploadImage, } from './components';
6
6
  // Queries configs
7
7
  import ContentSource from './components/organism/ContentSources';
8
+ import { queryClientAntsomiUI, QueryClientProviderAntsomiUI } from './queries';
8
9
  export const BACKGROUND_COLOR_STYLE = {
9
10
  SOLID: {
10
11
  value: 'color',
@@ -166,61 +167,31 @@ export const App = () => {
166
167
  // />
167
168
  // </div>
168
169
  // );
169
- // return (
170
- // <QueryClientProviderAntsomiUI client={queryClientAntsomiUI}>
171
- // <div
172
- // style={{
173
- // width: 500,
174
- // height: 500,
175
- // border: '1px solid black',
176
- // margin: '0 auto',
177
- // padding: 12,
178
- // borderRadius: '10px',
179
- // }}
180
- // >
181
- // <InputDynamic
182
- // errors={[]}
183
- // onChange={dataOut => setValueShortlink(dataOut)}
184
- // onError={() => {}}
185
- // isViewMode={false}
186
- // canMultipleLine={false}
187
- // allowDynamicOptions={['addPersonalization', 'shortlink']}
188
- // value={valueShortlink}
189
- // />
190
- // <SettingWrapper vertical label="Background Image" containerStyle={{ gap: '20px' }}>
191
- // <UploadImage
192
- // domainMedia="https://sandbox-media-template.antsomi.com"
193
- // slug="cdp/api/v1"
194
- // labelButtonSelect="Select Toggle from Computor"
195
- // labelHeadingModal="Toggle Selection"
196
- // searchPlaceholder="Search toggle"
197
- // paramConfigs={{
198
- // token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
199
- // userId: '1600084695',
200
- // accountId: '1600084695',
201
- // }}
202
- // // title="Background Image"
203
- // selectedImage={{
204
- // url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
205
- // }}
206
- // onChangeImage={image =>
207
- // // onChangeSettings('backgroundImageObj', {
208
- // // name: image.name,
209
- // // previewUrl: image.url,
210
- // // })
211
- // {}
212
- // }
213
- // onRemoveImage={() => {
214
- // // onChangeSettings('backgroundImageObj', {
215
- // // name: '',
216
- // // previewUrl: '',
217
- // // });
218
- // }}
219
- // />
220
- // </SettingWrapper>
221
- // </div>
222
- // </QueryClientProviderAntsomiUI>
223
- // );
170
+ return (React.createElement(QueryClientProviderAntsomiUI, { client: queryClientAntsomiUI },
171
+ React.createElement("div", { style: {
172
+ width: 500,
173
+ height: 500,
174
+ border: '1px solid black',
175
+ margin: '0 auto',
176
+ padding: 12,
177
+ borderRadius: '10px',
178
+ } },
179
+ React.createElement(InputDynamic, { errors: [], onChange: dataOut => setValueShortlink(dataOut), onError: () => { }, isViewMode: false, canMultipleLine: false, allowDynamicOptions: ['addPersonalization', 'shortlink'], value: valueShortlink }),
180
+ React.createElement(SettingWrapper, { vertical: true, label: "Background Image", containerStyle: { gap: '20px' } },
181
+ React.createElement(UploadImage, { domainMedia: "https://sandbox-media-template.antsomi.com", slug: "cdp/api/v1", labelButtonSelect: "Select Toggle from Computor", labelHeadingModal: "Toggle Selection", searchPlaceholder: "Search toggle", paramConfigs: {
182
+ token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
183
+ userId: '1600084695',
184
+ accountId: '1600084695',
185
+ },
186
+ // title="Background Image"
187
+ selectedImage: {
188
+ url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
189
+ }, onChangeImage: image => { }, onRemoveImage: () => {
190
+ // onChangeSettings('backgroundImageObj', {
191
+ // name: '',
192
+ // previewUrl: '',
193
+ // });
194
+ } })))));
224
195
  // --------------------------- Test SlideBar end -------------------------------------------
225
196
  // ---------------------------- Test Input Dynamic start ------------------------------
226
197
  // return (
@@ -453,6 +424,36 @@ export const App = () => {
453
424
  // <Slider className="test-classname" />
454
425
  // </div>
455
426
  // );
427
+ // ------------------------ Template Listing test -------------------------
428
+ // return (
429
+ // <div
430
+ // style={{
431
+ // height: '50vh',
432
+ // }}
433
+ // >
434
+ // <TemplateListing
435
+ // templatesProps={{
436
+ // items: templateItems,
437
+ // loading: isLoadingTemplateList,
438
+ // onLoadMoreTemplates,
439
+ // }}
440
+ // categoryListingProps={{
441
+ // loading: isLoadingCategoryList,
442
+ // items: categoryItems,
443
+ // checkedCategories,
444
+ // openKeys: openCategoryKeys,
445
+ // onOpenChange: onChangeOpenCategoryKeys,
446
+ // onMenuChange: onChangeCheckedCategories,
447
+ // }}
448
+ // templateItemProps={{
449
+ // removeModalProps: {
450
+ // // onOk
451
+ // onOk: onRemoveObjectTemplate,
452
+ // },
453
+ // }}
454
+ // />
455
+ // </div>
456
+ // );
456
457
  };
457
458
  const container = document.getElementById('root');
458
459
  const root = createRoot(container);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.138",
3
+ "version": "1.3.5-beta.139",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",