@mapples/components 1.0.1 → 1.1.1
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 +0 -81
- package/dist/components/ImageCarousel/CarouselItem.d.ts +40 -0
- package/dist/components/ImageCarousel/CarouselItem.d.ts.map +1 -1
- package/dist/components/ImageCarousel/CarouselItem.js +28 -0
- package/dist/components/ImageCarousel/CarouselItem.js.map +1 -1
- package/dist/components/ImageCarousel/CarouselItemIndicator.d.ts +24 -0
- package/dist/components/ImageCarousel/CarouselItemIndicator.d.ts.map +1 -1
- package/dist/components/ImageCarousel/CarouselItemIndicator.js +18 -0
- package/dist/components/ImageCarousel/CarouselItemIndicator.js.map +1 -1
- package/dist/components/ImageCarousel/index.d.ts +63 -0
- package/dist/components/ImageCarousel/index.d.ts.map +1 -1
- package/dist/components/ImageCarousel/index.js +35 -0
- package/dist/components/ImageCarousel/index.js.map +1 -1
- package/dist/components/ImageCarousel/schematic.d.ts +6 -0
- package/dist/components/ImageCarousel/schematic.d.ts.map +1 -1
- package/dist/components/ImageCarousel/schematic.js +6 -0
- package/dist/components/ImageCarousel/schematic.js.map +1 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/schematics.d.ts +15 -0
- package/dist/schematics.d.ts.map +1 -1
- package/dist/schematics.js +15 -0
- package/dist/schematics.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,82 +1 @@
|
|
|
1
1
|
# @mapples/components
|
|
2
|
-
|
|
3
|
-
Placeholder package for app-specific component registration in the Mapples Open Kit. Use this package to register custom components and schematics that will be available to the render system and visual editor.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Component registry** – Export a `Components` object compatible with `@mapples/render` and `RegisteredComponents` from `@mapples/types`
|
|
8
|
-
- **Schematics** – Attach component schematics (type, groupId, label, Icon, initialProps, styleKeys, props, actionProps) for visual editor integration
|
|
9
|
-
- **TypeScript** – Aligns with `@mapples/types` and `@mapples/ui` patterns
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @mapples/components
|
|
15
|
-
# or
|
|
16
|
-
yarn add @mapples/components
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
The package currently exports an empty **`Components`** registry and re-exports from **schematics**. Applications can:
|
|
22
|
-
|
|
23
|
-
1. **Extend in-app** – Import `@mapples/ui` (or other) components and merge with custom components, then pass the combined registry to `RenderProvider` (or use `MapplesApp` / `MapplesAppProvider` from `@mapples/app`, which use `@mapples/ui`’s `Components` by default).
|
|
24
|
-
|
|
25
|
-
2. **Use this package as the app shell** – Add local component definitions and schematics in `src/schematics.ts` (and related files), then build and consume `Components` from `@mapples/components` in your app’s provider setup.
|
|
26
|
-
|
|
27
|
-
### Example: custom component registration
|
|
28
|
-
|
|
29
|
-
```tsx
|
|
30
|
-
// In your app or in this package’s schematics
|
|
31
|
-
import { RegisteredComponent } from '@mapples/types';
|
|
32
|
-
import { MyWidget } from './MyWidget';
|
|
33
|
-
import { MyWidgetIcon } from './MyWidgetIcon';
|
|
34
|
-
|
|
35
|
-
const myWidgetSchematic: RegisteredComponent<MyWidgetProps> = {
|
|
36
|
-
type: 'MyWidget',
|
|
37
|
-
groupId: 'custom',
|
|
38
|
-
label: 'My Widget',
|
|
39
|
-
Component: MyWidget,
|
|
40
|
-
Icon: MyWidgetIcon,
|
|
41
|
-
initialProps: { title: '' },
|
|
42
|
-
styleKeys: [],
|
|
43
|
-
props: [],
|
|
44
|
-
actionProps: [],
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// Merge with existing Components when providing to RenderProvider
|
|
48
|
-
import { Components } from '@mapples/ui';
|
|
49
|
-
const allComponents = { ...Components, MyWidget: myWidgetSchematic };
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## API
|
|
53
|
-
|
|
54
|
-
- **`Components`** – `Record<string, RegisteredComponent>` (currently `{}`). Populate via this package’s schematics or by merging in your app.
|
|
55
|
-
- **Schematics** – Re-exported from `./schematics`; add your component definitions here for a single place to maintain the registry.
|
|
56
|
-
|
|
57
|
-
## Dependencies
|
|
58
|
-
|
|
59
|
-
- **@mapples/types** – For `RegisteredComponent`, `StyleKey`, `PropsFormField`, etc.
|
|
60
|
-
- **react** / **react-native** – For component implementations
|
|
61
|
-
- **react-native-svg** – For palette/icons when using SVG icons in schematics
|
|
62
|
-
|
|
63
|
-
## Integration
|
|
64
|
-
|
|
65
|
-
- **@mapples/app** – `MapplesApp` and `MapplesAppProvider` use `@mapples/ui`’s `Components` by default; replace or merge with `@mapples/components` if your app defines its components in this package.
|
|
66
|
-
- **@mapples/render** – `RenderProvider` accepts a `components` prop; pass the registry you build from this package and/or `@mapples/ui`.
|
|
67
|
-
|
|
68
|
-
## Development
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
npm run build
|
|
72
|
-
npm run type-check
|
|
73
|
-
npm run lint
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## License
|
|
77
|
-
|
|
78
|
-
MIT
|
|
79
|
-
|
|
80
|
-
## Author
|
|
81
|
-
|
|
82
|
-
Oleksandr Soloviov – [mapples.org](https://mapples.org/people/olek_soloviov)
|
|
@@ -2,19 +2,59 @@ import { FC } from 'react';
|
|
|
2
2
|
import { StyledProp } from '@mapples/style';
|
|
3
3
|
import { ImageProps, ImageStyle } from 'expo-image';
|
|
4
4
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
5
|
+
/** Controls how text is positioned relative to the image in a carousel item. */
|
|
5
6
|
export type ImageCarouselMode = 'textOver' | 'textUnder';
|
|
7
|
+
/** Props for a single item rendered inside {@link ImageCarousel}. */
|
|
6
8
|
export interface ImageCarouselItemProps {
|
|
9
|
+
/** The image source passed to the underlying `StyledImage` or `StyledImageBackground`. */
|
|
7
10
|
image?: any;
|
|
11
|
+
/** Primary text displayed over or under the image. */
|
|
8
12
|
title?: string;
|
|
13
|
+
/** Secondary text displayed below the title. */
|
|
9
14
|
subtitle?: string;
|
|
15
|
+
/** Layout mode: `'textOver'` renders text on top of the image; `'textUnder'` renders it beneath. */
|
|
10
16
|
mode?: ImageCarouselMode;
|
|
17
|
+
/** Additional props forwarded to the underlying `expo-image` `Image` component. */
|
|
11
18
|
imageProps?: ImageProps;
|
|
19
|
+
/** Styled prop applied to the outermost item container view. */
|
|
12
20
|
styleItemContainer?: StyledProp<ViewStyle>;
|
|
21
|
+
/** Styled prop applied to the image. */
|
|
13
22
|
styleImage?: StyledProp<ImageStyle>;
|
|
23
|
+
/** Styled prop applied to the text wrapper view. */
|
|
14
24
|
styleTextContainer?: StyledProp<ViewStyle>;
|
|
25
|
+
/** Styled prop applied to the title `Typography` element. */
|
|
15
26
|
styleTitle?: StyledProp<TextStyle>;
|
|
27
|
+
/** Styled prop applied to the subtitle `Typography` element. */
|
|
16
28
|
styleSubtitle?: StyledProp<TextStyle>;
|
|
17
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A single slide rendered inside an {@link ImageCarousel}.
|
|
32
|
+
*
|
|
33
|
+
* Depending on `mode`, text is either overlaid on top of the image (`'textOver'`,
|
|
34
|
+
* the default) or displayed in a separate view beneath it (`'textUnder'`).
|
|
35
|
+
*
|
|
36
|
+
* @param props - The component props.
|
|
37
|
+
* @param props.image - Image source for the slide.
|
|
38
|
+
* @param props.title - Primary heading text.
|
|
39
|
+
* @param props.subtitle - Secondary description text.
|
|
40
|
+
* @param props.mode - Layout mode controlling text placement.
|
|
41
|
+
* @param props.styleItemContainer - Styled prop for the outer container.
|
|
42
|
+
* @param props.styleImage - Styled prop for the image.
|
|
43
|
+
* @param props.styleTextContainer - Styled prop for the text wrapper.
|
|
44
|
+
* @param props.styleTitle - Styled prop for the title element.
|
|
45
|
+
* @param props.styleSubtitle - Styled prop for the subtitle element.
|
|
46
|
+
* @param props.imageProps - Extra props forwarded to the expo-image component.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <CarouselItem
|
|
51
|
+
* image={require('./slide.jpg')}
|
|
52
|
+
* title="Hello"
|
|
53
|
+
* subtitle="World"
|
|
54
|
+
* mode="textUnder"
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
18
58
|
declare const CarouselItem: FC<ImageCarouselItemProps>;
|
|
19
59
|
export default CarouselItem;
|
|
20
60
|
//# sourceMappingURL=CarouselItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselItem.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAGL,UAAU,EAGX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kBAAkB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACpC,kBAAkB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,UAAU,CAAC,SAAS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AE,CAAC,sBAAsB,CAwC5C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { StyledImage, StyledImageBackground, StyledView, Typography, } from '@mapples/style';
|
|
2
|
+
/**
|
|
3
|
+
* A single slide rendered inside an {@link ImageCarousel}.
|
|
4
|
+
*
|
|
5
|
+
* Depending on `mode`, text is either overlaid on top of the image (`'textOver'`,
|
|
6
|
+
* the default) or displayed in a separate view beneath it (`'textUnder'`).
|
|
7
|
+
*
|
|
8
|
+
* @param props - The component props.
|
|
9
|
+
* @param props.image - Image source for the slide.
|
|
10
|
+
* @param props.title - Primary heading text.
|
|
11
|
+
* @param props.subtitle - Secondary description text.
|
|
12
|
+
* @param props.mode - Layout mode controlling text placement.
|
|
13
|
+
* @param props.styleItemContainer - Styled prop for the outer container.
|
|
14
|
+
* @param props.styleImage - Styled prop for the image.
|
|
15
|
+
* @param props.styleTextContainer - Styled prop for the text wrapper.
|
|
16
|
+
* @param props.styleTitle - Styled prop for the title element.
|
|
17
|
+
* @param props.styleSubtitle - Styled prop for the subtitle element.
|
|
18
|
+
* @param props.imageProps - Extra props forwarded to the expo-image component.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <CarouselItem
|
|
23
|
+
* image={require('./slide.jpg')}
|
|
24
|
+
* title="Hello"
|
|
25
|
+
* subtitle="World"
|
|
26
|
+
* mode="textUnder"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
2
30
|
const CarouselItem = ({ image, title, subtitle, mode = 'textOver', styleItemContainer, styleImage, styleTextContainer, styleTitle, styleSubtitle, imageProps, }) => {
|
|
3
31
|
if (mode === 'textUnder') {
|
|
4
32
|
return (<StyledView styled={{ style: styleItemContainer }}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselItem.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,qBAAqB,EAErB,UAAU,EACV,UAAU,GACX,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CarouselItem.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,qBAAqB,EAErB,UAAU,EACV,UAAU,GACX,MAAM,gBAAgB,CAAC;AA+BxB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,YAAY,GAA+B,CAAC,EAChD,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,UAAU,EACjB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,UAAU,GACX,EAAE,EAAE;IACH,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzB,OAAO,CACL,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAChD;QAAA,CAAC,WAAW,CACV,IAAI,UAAU,CAAC,CACf,MAAM,CAAC,CAAC,KAAK,CAAC,CACd,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAEhC;QAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAChD;UAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAC9D;UAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,CACtE;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,qBAAqB,CACpB,IAAI,UAAU,CAAC,CACf,MAAM,CAAC,CAAC,KAAK,CAAC,CACd,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAE9D;MAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAChD;QAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAC9D;QAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,CACtE;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,qBAAqB,CAAC,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { StyledProp } from '@mapples/style';
|
|
3
3
|
import { ViewStyle } from 'react-native';
|
|
4
|
+
/** Props for the dot-based page indicator shown below an {@link ImageCarousel}. */
|
|
4
5
|
interface CarouselItemIndicatorProps {
|
|
6
|
+
/** Total number of slides (dots) to render. */
|
|
5
7
|
total: number;
|
|
8
|
+
/** Zero-based index of the currently visible slide. */
|
|
6
9
|
activeIndex: number;
|
|
10
|
+
/** Styled prop applied to the row container that wraps all dots. */
|
|
7
11
|
styleIndicatorContainer?: StyledProp<ViewStyle>;
|
|
12
|
+
/** Styled prop applied to every dot. */
|
|
8
13
|
styleIndicator?: StyledProp<ViewStyle>;
|
|
14
|
+
/** Styled prop applied to the currently active dot (merged on top of `styleIndicator`). */
|
|
9
15
|
styleIndicatorActive?: StyledProp<ViewStyle>;
|
|
10
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Row of dot indicators that reflect the current slide position in an
|
|
19
|
+
* {@link ImageCarousel}.
|
|
20
|
+
*
|
|
21
|
+
* Renders `total` dots and highlights the one at `activeIndex`.
|
|
22
|
+
*
|
|
23
|
+
* @param props - The component props.
|
|
24
|
+
* @param props.total - Number of dots to render.
|
|
25
|
+
* @param props.activeIndex - Index of the active dot.
|
|
26
|
+
* @param props.styleIndicatorContainer - Styled prop for the container row.
|
|
27
|
+
* @param props.styleIndicator - Styled prop applied to every dot.
|
|
28
|
+
* @param props.styleIndicatorActive - Additional styled prop for the active dot.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <CarouselItemIndicator total={5} activeIndex={2} />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
11
35
|
declare const CarouselItemIndicator: FC<CarouselItemIndicatorProps>;
|
|
12
36
|
export default CarouselItemIndicator;
|
|
13
37
|
//# sourceMappingURL=CarouselItemIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselItemIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItemIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,UAAU,0BAA0B;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChD,cAAc,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACvC,oBAAoB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CAC9C;AAED,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAsBzD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"CarouselItemIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItemIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,mFAAmF;AACnF,UAAU,0BAA0B;IAClC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,uBAAuB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChD,wCAAwC;IACxC,cAAc,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACvC,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAsBzD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { StyledView } from '@mapples/style';
|
|
2
|
+
/**
|
|
3
|
+
* Row of dot indicators that reflect the current slide position in an
|
|
4
|
+
* {@link ImageCarousel}.
|
|
5
|
+
*
|
|
6
|
+
* Renders `total` dots and highlights the one at `activeIndex`.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The component props.
|
|
9
|
+
* @param props.total - Number of dots to render.
|
|
10
|
+
* @param props.activeIndex - Index of the active dot.
|
|
11
|
+
* @param props.styleIndicatorContainer - Styled prop for the container row.
|
|
12
|
+
* @param props.styleIndicator - Styled prop applied to every dot.
|
|
13
|
+
* @param props.styleIndicatorActive - Additional styled prop for the active dot.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <CarouselItemIndicator total={5} activeIndex={2} />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
2
20
|
const CarouselItemIndicator = ({ total, activeIndex, styleIndicatorContainer, styleIndicator, styleIndicatorActive, }) => {
|
|
3
21
|
return (<StyledView styled={{ style: styleIndicatorContainer }}>
|
|
4
22
|
{Array.from({ length: total }).map((_, index) => (<StyledView key={index} styled={{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselItemIndicator.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItemIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CarouselItemIndicator.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/CarouselItemIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAiBxD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,qBAAqB,GAAmC,CAAC,EAC7D,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,oBAAoB,GACrB,EAAE,EAAE;IACH,OAAO,CACL,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CACrD;MAAA,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/C,CAAC,UAAU,CACT,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,MAAM,CAAC,CAAC;gBACN,KAAK,EAAE;oBACL,cAAc;oBACd,KAAK,KAAK,WAAW,IAAI,oBAAoB;iBAC9C;aACF,CAAC,EACF,CACH,CAAC,CACJ;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -2,30 +2,93 @@ import { StyledProp } from '@mapples/style';
|
|
|
2
2
|
import { ImageProps } from 'expo-image';
|
|
3
3
|
import { ImageStyle, TextStyle, View, ViewStyle } from 'react-native';
|
|
4
4
|
import { ImageCarouselMode } from './CarouselItem';
|
|
5
|
+
/**
|
|
6
|
+
* Shape of a single data record accepted by {@link ImageCarousel}.
|
|
7
|
+
*
|
|
8
|
+
* Field names can be remapped via `keyMap` so any object shape is supported.
|
|
9
|
+
*/
|
|
5
10
|
export interface ImageCarouselDataItem {
|
|
11
|
+
/** Image source for the slide. */
|
|
6
12
|
image?: any;
|
|
13
|
+
/** Primary heading text. */
|
|
7
14
|
title?: string;
|
|
15
|
+
/** Secondary description text. */
|
|
8
16
|
subtitle?: string;
|
|
17
|
+
/** Unique identifier used as the FlatList `key`. */
|
|
9
18
|
id?: string | number;
|
|
10
19
|
}
|
|
20
|
+
/** Props for {@link ImageCarousel}. */
|
|
11
21
|
export interface ImageCarouselProps<T extends ImageCarouselDataItem> {
|
|
22
|
+
/** Array of data items to render as slides. */
|
|
12
23
|
data?: T[];
|
|
24
|
+
/** Controls text placement: `'textOver'` (default) or `'textUnder'`. */
|
|
13
25
|
mode?: ImageCarouselMode;
|
|
26
|
+
/** Whether to render the dot page-indicator below the carousel. Defaults to `true`. */
|
|
14
27
|
showIndicators?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Maps the expected `ImageCarouselDataItem` field names to the actual keys on
|
|
30
|
+
* each `data` record, enabling arbitrary data shapes without transformation.
|
|
31
|
+
*/
|
|
15
32
|
keyMap?: Record<keyof ImageCarouselDataItem, string>;
|
|
33
|
+
/** Extra props forwarded to the underlying `expo-image` component in each slide. */
|
|
16
34
|
imageProps?: ImageProps;
|
|
35
|
+
/** Styled props for every visual part of the carousel. */
|
|
17
36
|
styled?: {
|
|
37
|
+
/** Styled prop for the outermost container view. */
|
|
18
38
|
style?: StyledProp<ViewStyle>;
|
|
39
|
+
/** Styled prop for each indicator dot. */
|
|
19
40
|
styleIndicator?: StyledProp<ViewStyle>;
|
|
41
|
+
/** Additional styled prop applied to the active indicator dot. */
|
|
20
42
|
styleIndicatorActive?: StyledProp<ViewStyle>;
|
|
43
|
+
/** Styled prop for each slide's container view. */
|
|
21
44
|
styleItemContainer?: StyledProp<ViewStyle>;
|
|
45
|
+
/** Styled prop for each slide's image. */
|
|
22
46
|
styleImage?: StyledProp<ImageStyle>;
|
|
47
|
+
/** Styled prop for each slide's text wrapper view. */
|
|
23
48
|
styleTextContainer?: StyledProp<ViewStyle>;
|
|
49
|
+
/** Styled prop for each slide's title element. */
|
|
24
50
|
styleTitle?: StyledProp<TextStyle>;
|
|
51
|
+
/** Styled prop for each slide's subtitle element. */
|
|
25
52
|
styleSubtitle?: StyledProp<TextStyle>;
|
|
53
|
+
/** Styled prop for the indicator row container. */
|
|
26
54
|
styleIndicatorContainer?: StyledProp<ViewStyle>;
|
|
27
55
|
};
|
|
28
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Horizontally scrollable image carousel with optional dot page indicators.
|
|
59
|
+
*
|
|
60
|
+
* Accepts an array of data items and renders each one as a full-width slide
|
|
61
|
+
* via {@link CarouselItem}. The active slide is tracked automatically using
|
|
62
|
+
* `FlatList` viewability callbacks, and the {@link CarouselItemIndicator} is
|
|
63
|
+
* updated accordingly.
|
|
64
|
+
*
|
|
65
|
+
* Use `keyMap` to adapt objects whose field names differ from the defaults
|
|
66
|
+
* (`image`, `title`, `subtitle`, `id`).
|
|
67
|
+
*
|
|
68
|
+
* @param props - The component props.
|
|
69
|
+
* @param props.data - Array of slide data items.
|
|
70
|
+
* @param props.mode - Text placement mode for each slide.
|
|
71
|
+
* @param props.showIndicators - Whether to show dot indicators.
|
|
72
|
+
* @param props.keyMap - Field-name remapping for data items.
|
|
73
|
+
* @param props.imageProps - Extra props forwarded to the image in each slide.
|
|
74
|
+
* @param props.styled - Styled props for every visual layer.
|
|
75
|
+
* @param ref - Forwarded ref attached to the outermost `View`.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* const slides = [
|
|
80
|
+
* { image: require('./a.jpg'), title: 'Slide 1', subtitle: 'Description', id: '1' },
|
|
81
|
+
* { image: require('./b.jpg'), title: 'Slide 2', subtitle: 'Description', id: '2' },
|
|
82
|
+
* ];
|
|
83
|
+
*
|
|
84
|
+
* <ImageCarousel
|
|
85
|
+
* data={slides}
|
|
86
|
+
* mode="textUnder"
|
|
87
|
+
* showIndicators
|
|
88
|
+
* styled={{ style: { height: 200 } }}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
29
92
|
declare const ImageCarousel: import("react").ForwardRefExoticComponent<ImageCarouselProps<any> & import("react").RefAttributes<View>>;
|
|
30
93
|
export default ImageCarousel;
|
|
31
94
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EACL,UAAU,EAEV,SAAS,EACT,IAAI,EACJ,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGjE,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AASD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,qBAAqB;IACjE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,qBAAqB,EAAE,MAAM,CAAC,CAAC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title',
|
|
10
10
|
id: 'id',
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Horizontally scrollable image carousel with optional dot page indicators.
|
|
14
|
+
*
|
|
15
|
+
* Accepts an array of data items and renders each one as a full-width slide
|
|
16
|
+
* via {@link CarouselItem}. The active slide is tracked automatically using
|
|
17
|
+
* `FlatList` viewability callbacks, and the {@link CarouselItemIndicator} is
|
|
18
|
+
* updated accordingly.
|
|
19
|
+
*
|
|
20
|
+
* Use `keyMap` to adapt objects whose field names differ from the defaults
|
|
21
|
+
* (`image`, `title`, `subtitle`, `id`).
|
|
22
|
+
*
|
|
23
|
+
* @param props - The component props.
|
|
24
|
+
* @param props.data - Array of slide data items.
|
|
25
|
+
* @param props.mode - Text placement mode for each slide.
|
|
26
|
+
* @param props.showIndicators - Whether to show dot indicators.
|
|
27
|
+
* @param props.keyMap - Field-name remapping for data items.
|
|
28
|
+
* @param props.imageProps - Extra props forwarded to the image in each slide.
|
|
29
|
+
* @param props.styled - Styled props for every visual layer.
|
|
30
|
+
* @param ref - Forwarded ref attached to the outermost `View`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const slides = [
|
|
35
|
+
* { image: require('./a.jpg'), title: 'Slide 1', subtitle: 'Description', id: '1' },
|
|
36
|
+
* { image: require('./b.jpg'), title: 'Slide 2', subtitle: 'Description', id: '2' },
|
|
37
|
+
* ];
|
|
38
|
+
*
|
|
39
|
+
* <ImageCarousel
|
|
40
|
+
* data={slides}
|
|
41
|
+
* mode="textUnder"
|
|
42
|
+
* showIndicators
|
|
43
|
+
* styled={{ style: { height: 200 } }}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
12
47
|
const ImageCarousel = forwardRef(({ styled, keyMap = defaultKeyMap, data = [], mode = 'textOver', showIndicators = true, imageProps, }, ref) => {
|
|
13
48
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
14
49
|
const viewabilityConfig = useRef({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAS7B,OAAO,YAAmC,MAAM,gBAAgB,CAAC;AACjE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAS7B,OAAO,YAAmC,MAAM,gBAAgB,CAAC;AACjE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAkB5D,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,EAAE,EAAE,IAAI;CACT,CAAC;AAwCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,aAAa,GAAG,UAAU,CAC9B,CACE,EACE,MAAM,EACN,MAAM,GAAG,aAAa,EACtB,IAAI,GAAG,EAAE,EACT,IAAI,GAAG,UAAU,EACjB,cAAc,GAAG,IAAI,EACrB,UAAU,GACX,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,MAA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U;QACV,kBAAkB;QAClB,aAAa;QACb,kBAAkB;QAClB,UAAU;KACX,CACF,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CACtC;QAAA,CAAC,cAAc,CACb,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CACV,aAAa,CACb,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAC3D,8BAA8B,CAAC,CAAC,KAAK,CAAC,CACtC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CACvD,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAE/C;QAAA,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CACpC,CAAC,qBAAqB,CACpB,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACnB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,uBAAuB,CAAC,CAAC,uBAAuB,CAAC,EACjD,CACH,CACH;MAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,eAAe,aAAa,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { RegisteredComponent } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic registration entry for the {@link ImageCarousel} component.
|
|
4
|
+
*
|
|
5
|
+
* Registers `ImageCarousel` under the `'ImageCarousel'` type key so it can be
|
|
6
|
+
* resolved by the `@mapples/render` pipeline via the {@link Components} registry.
|
|
7
|
+
*/
|
|
2
8
|
export declare const ImageCarouselSchematic: RegisteredComponent;
|
|
3
9
|
//# sourceMappingURL=schematic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematic.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/schematic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,eAAO,MAAM,sBAAsB,EAAE,mBAGpC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematic.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCarousel/schematic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,mBAGpC,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import ImageCarousel from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Schematic registration entry for the {@link ImageCarousel} component.
|
|
4
|
+
*
|
|
5
|
+
* Registers `ImageCarousel` under the `'ImageCarousel'` type key so it can be
|
|
6
|
+
* resolved by the `@mapples/render` pipeline via the {@link Components} registry.
|
|
7
|
+
*/
|
|
2
8
|
export const ImageCarouselSchematic = {
|
|
3
9
|
type: 'ImageCarousel',
|
|
4
10
|
Component: ImageCarousel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematic.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/schematic.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,SAAS,CAAC;AAEpC,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,IAAI,EAAE,eAAe;IACrB,SAAS,EAAE,aAAoB;CAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematic.js","sourceRoot":"","sources":["../../../src/components/ImageCarousel/schematic.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,IAAI,EAAE,eAAe;IACrB,SAAS,EAAE,aAAoB;CAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module @mapples/components
|
|
4
|
-
*
|
|
5
|
-
* Placeholder package for app-specific component registration in the Mapples Open Kit.
|
|
6
|
-
* Export a Components registry and schematics for use with @mapples/render and visual editors.
|
|
7
|
-
*/
|
|
8
1
|
export * from './schematics';
|
|
9
2
|
export { default as ImageCarousel } from './components/ImageCarousel';
|
|
10
3
|
export * from './components/ImageCarousel/schematic';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,cAAc,sCAAsC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module @mapples/components
|
|
4
|
-
*
|
|
5
|
-
* Placeholder package for app-specific component registration in the Mapples Open Kit.
|
|
6
|
-
* Export a Components registry and schematics for use with @mapples/render and visual editors.
|
|
7
|
-
*/
|
|
8
1
|
export * from './schematics';
|
|
9
2
|
export { default as ImageCarousel } from './components/ImageCarousel';
|
|
10
3
|
export * from './components/ImageCarousel/schematic';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,cAAc,sCAAsC,CAAC"}
|
package/dist/schematics.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import { RegisteredComponents } from '@mapples/types';
|
|
2
|
+
/**
|
|
3
|
+
* Registry of all `@mapples/components` components, keyed by their schematic
|
|
4
|
+
* `type` string.
|
|
5
|
+
*
|
|
6
|
+
* Pass this object to the `@mapples/render` pipeline so it can resolve
|
|
7
|
+
* component types at runtime.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Components } from '@mapples/components';
|
|
12
|
+
* import { RenderEngine } from '@mapples/render';
|
|
13
|
+
*
|
|
14
|
+
* <RenderEngine components={Components} tree={tree} />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
2
17
|
export declare const Components: RegisteredComponents;
|
|
3
18
|
//# sourceMappingURL=schematics.d.ts.map
|
package/dist/schematics.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAItD,eAAO,MAAM,UAAU,EAAE,oBAExB,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.d.ts","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAItD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,EAAE,oBAExB,CAAC"}
|
package/dist/schematics.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { ImageCarouselSchematic } from './components/ImageCarousel/schematic';
|
|
2
|
+
/**
|
|
3
|
+
* Registry of all `@mapples/components` components, keyed by their schematic
|
|
4
|
+
* `type` string.
|
|
5
|
+
*
|
|
6
|
+
* Pass this object to the `@mapples/render` pipeline so it can resolve
|
|
7
|
+
* component types at runtime.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Components } from '@mapples/components';
|
|
12
|
+
* import { RenderEngine } from '@mapples/render';
|
|
13
|
+
*
|
|
14
|
+
* <RenderEngine components={Components} tree={tree} />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
2
17
|
export const Components = {
|
|
3
18
|
[ImageCarouselSchematic.type]: ImageCarouselSchematic,
|
|
4
19
|
};
|
package/dist/schematics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,sBAAsB;CACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"schematics.js","sourceRoot":"","sources":["../src/schematics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,sBAAsB;CACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapples/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": ">=18.0.0 <20.0.0",
|
|
29
|
-
"typescript": "~
|
|
29
|
+
"typescript": "~6.0.3"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|