@brilo/base-blocks 0.1.53 → 0.1.54

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 +1 @@
1
- {"version":3,"file":"JobPositionsSelectModal.d.ts","sourceRoot":"","sources":["../../../../src/blocks/career/job-position-group/JobPositionsSelectModal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AA0G/C;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAC,EAAE,kBAAkB,qBAuHpF"}
1
+ {"version":3,"file":"JobPositionsSelectModal.d.ts","sourceRoot":"","sources":["../../../../src/blocks/career/job-position-group/JobPositionsSelectModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AA0G/C;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAC,EAAE,kBAAkB,qBAuHpF"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import apiFetch from '@wordpress/api-fetch';
3
3
  import { Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack } from '@wordpress/components';
4
- import { DataViews } from '@wordpress/dataviews/wp';
4
+ import { LazyDataViews as DataViews } from '../../../components/LazyDataViews/LazyDataViews';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { arrowDown, arrowUp, close, plusCircle } from '@wordpress/icons';
7
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsSelectModal.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-grid/DocumentsSelectModal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAgH/C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAC,EAAE,kBAAkB,qBAiJjF"}
1
+ {"version":3,"file":"DocumentsSelectModal.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-grid/DocumentsSelectModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAgH/C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAC,EAAE,kBAAkB,qBAiJjF"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import apiFetch from '@wordpress/api-fetch';
3
3
  import { Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack } from '@wordpress/components';
4
- import { DataViews } from '@wordpress/dataviews/wp';
4
+ import { LazyDataViews as DataViews } from '../../../components/LazyDataViews/LazyDataViews';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { arrowDown, arrowUp, close, plusCircle } from '@wordpress/icons';
7
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -1,4 +1,4 @@
1
- import { type Field, type View } from '@wordpress/dataviews/wp';
1
+ import type { Field, View } from '@wordpress/dataviews/wp';
2
2
  import React from 'react';
3
3
  import type { SelectControlProps } from '../../types';
4
4
  type EntityRecord = {
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySelectModal.d.ts","sourceRoot":"","sources":["../../../src/components/EntitySelectModal/EntitySelectModal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,KAAK,EAAE,KAAK,IAAI,EAAC,MAAM,yBAAyB,CAAA;AAIxE,OA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IAC5D,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAClB,WAAW,EAAE,IAAI,CAAA;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAA;IACjC,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAA;IACnD,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAA;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA2FD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,iCACnC,kBAAkB,uBAwGhF"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import apiFetch from '@wordpress/api-fetch';
3
3
  import { Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack } from '@wordpress/components';
4
- import { DataViews } from '@wordpress/dataviews/wp';
4
+ import { LazyDataViews as DataViews } from '../../components/LazyDataViews/LazyDataViews';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { arrowDown, arrowUp, close, plusCircle } from '@wordpress/icons';
7
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -0,0 +1,8 @@
1
+ import type { DataViews as DataViewsComponent } from '@wordpress/dataviews/wp';
2
+ /**
3
+ * `@wordpress/dataviews/wp` is a ~2 MB prebundle that WP core doesn't expose as a script handle,
4
+ * so a static import gets copied into every block entry that uses it. Loading it via `import()`
5
+ * lets webpack emit a single shared async chunk, fetched only once a picker modal is opened.
6
+ */
7
+ export declare const LazyDataViews: typeof DataViewsComponent;
8
+ //# sourceMappingURL=LazyDataViews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LazyDataViews.d.ts","sourceRoot":"","sources":["../../../src/components/LazyDataViews/LazyDataViews.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAA;AAM5E;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAIpB,OAAO,kBAAkB,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Spinner } from '@wordpress/components';
3
+ // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
4
+ import { lazy, Suspense } from 'react';
5
+ const DataViews = lazy(() => import('@wordpress/dataviews/wp').then((module) => ({ default: module.DataViews })));
6
+ /**
7
+ * `@wordpress/dataviews/wp` is a ~2 MB prebundle that WP core doesn't expose as a script handle,
8
+ * so a static import gets copied into every block entry that uses it. Loading it via `import()`
9
+ * lets webpack emit a single shared async chunk, fetched only once a picker modal is opened.
10
+ */
11
+ export const LazyDataViews = ((props) => (_jsx(Suspense, { fallback: _jsx(Spinner, {}), children: _jsx(DataViews, { ...props }) })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brilo/base-blocks",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "author": "Brilo",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import apiFetch from '@wordpress/api-fetch'
2
2
  import {Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack} from '@wordpress/components'
3
- import {DataViews, type View} from '@wordpress/dataviews/wp'
3
+ import type {View} from '@wordpress/dataviews/wp'
4
+ import {LazyDataViews as DataViews} from '~/components/LazyDataViews/LazyDataViews'
4
5
  import {__} from '@wordpress/i18n'
5
6
  import {arrowDown, arrowUp, close, plusCircle} from '@wordpress/icons'
6
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -1,6 +1,7 @@
1
1
  import apiFetch from '@wordpress/api-fetch'
2
2
  import {Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack} from '@wordpress/components'
3
- import {DataViews, type View} from '@wordpress/dataviews/wp'
3
+ import type {View} from '@wordpress/dataviews/wp'
4
+ import {LazyDataViews as DataViews} from '~/components/LazyDataViews/LazyDataViews'
4
5
  import {__} from '@wordpress/i18n'
5
6
  import {arrowDown, arrowUp, close, plusCircle} from '@wordpress/icons'
6
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -1,6 +1,7 @@
1
1
  import apiFetch from '@wordpress/api-fetch'
2
2
  import {Button, Card, CardBody, __experimentalHStack as HStack, Modal, __experimentalVStack as VStack} from '@wordpress/components'
3
- import {DataViews, type Field, type View} from '@wordpress/dataviews/wp'
3
+ import type {Field, View} from '@wordpress/dataviews/wp'
4
+ import {LazyDataViews as DataViews} from '~/components/LazyDataViews/LazyDataViews'
4
5
  import {__} from '@wordpress/i18n'
5
6
  import {arrowDown, arrowUp, close, plusCircle} from '@wordpress/icons'
6
7
  // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
@@ -0,0 +1,17 @@
1
+ import {Spinner} from '@wordpress/components'
2
+ import type {DataViews as DataViewsComponent} from '@wordpress/dataviews/wp'
3
+ // biome-ignore lint/correctness/noUnusedImports: required in scope for classic JSX transform
4
+ import React, {type ComponentProps, lazy, Suspense} from 'react'
5
+
6
+ const DataViews = lazy(() => import('@wordpress/dataviews/wp').then((module) => ({default: module.DataViews})))
7
+
8
+ /**
9
+ * `@wordpress/dataviews/wp` is a ~2 MB prebundle that WP core doesn't expose as a script handle,
10
+ * so a static import gets copied into every block entry that uses it. Loading it via `import()`
11
+ * lets webpack emit a single shared async chunk, fetched only once a picker modal is opened.
12
+ */
13
+ export const LazyDataViews = ((props: ComponentProps<typeof DataViewsComponent>) => (
14
+ <Suspense fallback={<Spinner />}>
15
+ <DataViews {...props} />
16
+ </Suspense>
17
+ )) as typeof DataViewsComponent