@draftbit/core 43.6.0-alpha.5 → 43.6.1-3d1384.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/lib/commonjs/components/DeprecatedButton.js +19 -4
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Justification.js +3 -0
- package/lib/commonjs/components/ResizeMode.js +3 -0
- package/lib/commonjs/mappings/MapView.js +11 -4
- package/lib/commonjs/mappings/MapView.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/View.js +1 -1
- package/lib/commonjs/mappings/View.js.map +1 -1
- package/lib/module/components/Justification.js +1 -1
- package/lib/module/components/ResizeMode.js +1 -1
- package/lib/module/components/Switch.js +21 -10
- package/lib/module/components/Switch.js.map +1 -1
- package/lib/module/mappings/MapView.js +12 -5
- package/lib/module/mappings/MapView.js.map +1 -1
- package/lib/module/mappings/View.js +1 -1
- package/lib/module/mappings/View.js.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/View.d.ts +1 -1
- package/package.json +3 -3
- package/src/Provider.js +9 -0
- package/src/components/Accordion/AccordionGroup.js +44 -0
- package/src/components/Accordion/AccordionItem.js +32 -0
- package/src/components/Accordion/index.js +2 -0
- package/src/components/ActionSheet/ActionSheet.js +45 -0
- package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
- package/src/components/ActionSheet/ActionSheetItem.js +30 -0
- package/src/components/ActionSheet/index.js +3 -0
- package/src/components/AnimatedCircularProgress.js +43 -0
- package/src/components/AspectRatio.js +18 -0
- package/src/components/AvatarEdit.js +30 -0
- package/src/components/Banner.js +109 -0
- package/src/components/Button.js +112 -0
- package/src/components/Card.js +57 -0
- package/src/components/CardBlock.js +54 -0
- package/src/components/CardContainer.js +69 -0
- package/src/components/CardContainerRating.js +79 -0
- package/src/components/CardContainerShortImage.js +33 -0
- package/src/components/CardInline.js +36 -0
- package/src/components/Carousel.js +66 -0
- package/src/components/Checkbox/Checkbox.js +63 -0
- package/src/components/Checkbox/CheckboxGroup.js +21 -0
- package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
- package/src/components/Checkbox/CheckboxRow.js +78 -0
- package/src/components/Checkbox/context.js +14 -0
- package/src/components/Checkbox/index.js +3 -0
- package/src/components/CircleImage.js +8 -0
- package/src/components/CircularProgress.js +78 -0
- package/src/components/Config.js +63 -0
- package/src/components/Container.js +44 -0
- package/src/components/DatePicker/DatePicker.js +368 -0
- package/src/components/DatePicker/DatePickerComponent.js +13 -0
- package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
- package/src/components/DatePicker/DatePickerComponentType.js +1 -0
- package/src/components/DeprecatedButton.js +95 -0
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedFAB.js +115 -0
- package/src/components/Divider.js +13 -0
- package/src/components/Elevation.js +20 -0
- package/src/components/FAB.js +46 -0
- package/src/components/FieldSearchBarFull.js +53 -0
- package/src/components/FormRow.js +19 -0
- package/src/components/Header.js +44 -0
- package/src/components/HeaderLarge.js +7 -0
- package/src/components/HeaderMedium.js +7 -0
- package/src/components/HeaderOverline.js +7 -0
- package/src/components/IconButton.js +35 -0
- package/src/components/Image.js +47 -0
- package/src/components/Justification.js +1 -0
- package/src/components/Layout.js +50 -0
- package/src/components/NumberInput.js +49 -0
- package/src/components/Picker/Picker.js +56 -0
- package/src/components/Picker/PickerComponent.android.js +68 -0
- package/src/components/Picker/PickerComponent.ios.js +78 -0
- package/src/components/Picker/PickerComponent.web.js +69 -0
- package/src/components/Picker/PickerTypes.js +1 -0
- package/src/components/Portal/Portal.js +35 -0
- package/src/components/Portal/PortalConsumer.js +28 -0
- package/src/components/Portal/PortalHost.js +105 -0
- package/src/components/Portal/PortalManager.js +29 -0
- package/src/components/ProgressBar.js +118 -0
- package/src/components/ProgressCircle.js +13 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/RadioButton/RadioButton.js +17 -0
- package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
- package/src/components/RadioButton/RadioButtonGroup.js +43 -0
- package/src/components/RadioButton/RadioButtonRow.js +76 -0
- package/src/components/RadioButton/context.js +14 -0
- package/src/components/RadioButton/index.js +4 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/Row.js +48 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/ScreenContainer.js +34 -0
- package/src/components/Slider.js +63 -0
- package/src/components/StarRating.js +50 -0
- package/src/components/StepIndicator.js +346 -0
- package/src/components/Stepper.js +39 -0
- package/src/components/Surface.js +32 -0
- package/src/components/Swiper/Swiper.js +18 -0
- package/src/components/Swiper/SwiperItem.js +9 -0
- package/src/components/Swiper/index.js +2 -0
- package/src/components/Switch.js +56 -0
- package/src/components/Text.js +28 -0
- package/src/components/TextField.js +420 -0
- package/src/components/ToggleButton.js +39 -0
- package/src/components/Touchable.js +12 -0
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Typography.js +36 -0
- package/src/components/useAuthState.js +31 -0
- package/src/constants.js +10 -0
- package/src/hooks.js +12 -0
- package/src/index.js +51 -0
- package/src/interfaces/Icon.js +8 -0
- package/src/mappings/Accordion.js +41 -0
- package/src/mappings/AccordionItem.js +16 -0
- package/src/mappings/ActionSheet.js +13 -0
- package/src/mappings/ActionSheetCancel.js +19 -0
- package/src/mappings/ActionSheetItem.js +22 -0
- package/src/mappings/ActivityIndicator.js +53 -0
- package/src/mappings/AudioPlayer.js +20 -0
- package/src/mappings/AvatarEdit.js +37 -0
- package/src/mappings/Banner.js +32 -0
- package/src/mappings/BlurView.js +41 -0
- package/src/mappings/Button.js +56 -0
- package/src/mappings/Card.js +52 -0
- package/src/mappings/CardBlock.js +122 -0
- package/src/mappings/CardContainer.js +102 -0
- package/src/mappings/CardContainerRating.js +124 -0
- package/src/mappings/CardContainerShortImage.js +118 -0
- package/src/mappings/CardInline.js +51 -0
- package/src/mappings/Carousel.js +18 -0
- package/src/mappings/Checkbox.js +45 -0
- package/src/mappings/CheckboxGroup.js +25 -0
- package/src/mappings/CheckboxRow.js +56 -0
- package/src/mappings/CircleImage.js +24 -0
- package/src/mappings/Container.js +29 -0
- package/src/mappings/CustomCode.js +8 -0
- package/src/mappings/DatePicker.js +146 -0
- package/src/mappings/Divider.js +26 -0
- package/src/mappings/FAB.js +36 -0
- package/src/mappings/Fetch.js +12 -0
- package/src/mappings/FieldSearchBarFull.js +49 -0
- package/src/mappings/FlatList.js +19 -0
- package/src/mappings/HeaderLarge.js +28 -0
- package/src/mappings/HeaderMedium.js +54 -0
- package/src/mappings/HeaderOverline.js +54 -0
- package/src/mappings/Icon.js +25 -0
- package/src/mappings/IconButton.js +30 -0
- package/src/mappings/Image.js +15 -0
- package/src/mappings/ImageBackground.js +28 -0
- package/src/mappings/KeyboardAvoidingView.js +40 -0
- package/src/mappings/KeyboardAwareScrollView.js +43 -0
- package/src/mappings/Layout.js +195 -0
- package/src/mappings/LinearGradient.js +77 -0
- package/src/mappings/MapCallout.js +20 -0
- package/src/mappings/MapMarker.js +47 -0
- package/src/mappings/MapView.js +132 -0
- package/src/mappings/MapView.ts +9 -1
- package/src/mappings/Modal.js +41 -0
- package/src/mappings/Picker.js +137 -0
- package/src/mappings/ProgressBar.js +100 -0
- package/src/mappings/ProgressCircle.js +108 -0
- package/src/mappings/ProgressIndicator.js +180 -0
- package/src/mappings/RadioButton.js +50 -0
- package/src/mappings/RadioButtonGroup.js +16 -0
- package/src/mappings/RadioButtonRow.js +37 -0
- package/src/mappings/RowBodyIcon.js +75 -0
- package/src/mappings/RowHeadlineImageCaption.js +167 -0
- package/src/mappings/RowHeadlineImageIcon.js +99 -0
- package/src/mappings/SafeAreaView.js +33 -0
- package/src/mappings/ScrollView.js +30 -0
- package/src/mappings/Slider.js +59 -0
- package/src/mappings/StarRating.js +42 -0
- package/src/mappings/Stepper.js +28 -0
- package/src/mappings/Surface.js +13 -0
- package/src/mappings/Swiper.js +60 -0
- package/src/mappings/SwiperItem.js +8 -0
- package/src/mappings/Switch.js +75 -0
- package/src/mappings/Text.js +227 -0
- package/src/mappings/TextArea.js +52 -0
- package/src/mappings/TextField.js +158 -0
- package/src/mappings/TextInput.js +208 -0
- package/src/mappings/ToggleButton.js +45 -0
- package/src/mappings/Touchable.js +12 -0
- package/src/mappings/Video.js +74 -0
- package/src/mappings/View.js +206 -0
- package/src/mappings/View.ts +1 -1
- package/src/mappings/WebView.js +18 -0
- package/src/styles/DarkTheme.js +26 -0
- package/src/styles/DefaultTheme.js +111 -0
- package/src/styles/fonts.js +62 -0
- package/src/styles/overlay.js +60 -0
- package/src/styles/shadow.js +51 -0
- package/src/theming.js +3 -0
- package/src/utilities.js +54 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MapView.ts"],"names":["COMPONENT_TYPES","createBoolProp","createColorProp","createNumberProp","GROUPS","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","packageName","description","category","media","layout","height","width","props","provider","formType","flatArray","propType","STRING","editable","group","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","latitudeDelta","longitudeDelta","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,eAHF,EAIEC,gBAJF,EAKEC,
|
|
1
|
+
{"version":3,"sources":["MapView.ts"],"names":["COMPONENT_TYPES","createBoolProp","createColorProp","createNumberProp","createTextProp","GROUPS","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","packageName","description","category","media","layout","height","width","props","provider","formType","flatArray","propType","STRING","editable","group","basic","label","required","defaultValue","options","latitude","precision","min","max","longitude","latitudeDelta","longitudeDelta","zoom","step","mapType","zoomEnabled","showsCompass","rotateEnabled","scrollEnabled","loadingEnabled","loadingIndicatorColor","loadingBackgroundColor","apiKey","process","env","GOOGLE_MAPS_API_KEY"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,eAHF,EAIEC,gBAJF,EAKEC,cALF,EAMEC,MANF,EAOEC,UAPF,EAQEC,UARF,QASO,iBATP;AAWA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,gBAHU;AAIvBC,EAAAA,WAAW,EAAE,YAJU;AAKvBC,EAAAA,QAAQ,EAAEb,eAAe,CAACc,KALH;AAMvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE,MADF;AAENC,IAAAA,KAAK,EAAE;AAFD,GANe;AAUvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,QAAQ,EAAEd,UAAU,CAACe,SADb;AAERC,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,MAFb;AAGRC,MAAAA,QAAQ,EAAE,IAHF;AAIRC,MAAAA,KAAK,EAAEpB,MAAM,CAACqB,KAJN;AAKRC,MAAAA,KAAK,EAAE,UALC;AAMRf,MAAAA,WAAW,EAAE,mBANL;AAORgB,MAAAA,QAAQ,EAAE,KAPF;AAQRC,MAAAA,YAAY,EAAE,IARN;AASRC,MAAAA,OAAO,EAAE,CAAC,QAAD;AATD,KADL;AAYLC,IAAAA,QAAQ,EAAE5B,gBAAgB,CAAC;AACzBwB,MAAAA,KAAK,EAAE,kBADkB;AAEzBf,MAAAA,WAAW,EAAE,4CAFY;AAGzBgB,MAAAA,QAAQ,EAAE,KAHe;AAIzBI,MAAAA,SAAS,EAAE,CAJc;AAKzBC,MAAAA,GAAG,EAAE,CAAC,EALmB;AAM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C;AAC5B0B,MAAAA,KAAK,EAAE,gBADqB;AAE5Bf,MAAAA,WAAW,EAAE,2CAFe;AAG5Ba,MAAAA,KAAK,EAAEpB,MAAM,CAACqB,KAHc;AAI5BE,MAAAA,QAAQ,EAAE,KAJkB;AAK5BC,MAAAA,YAAY,EAAE;AALc,KAAD,CA7FxB;AAoGLgB,IAAAA,cAAc,EAAE5C,cAAc,CAAC;AAC7B0B,MAAAA,KAAK,EAAE,iBADsB;AAE7Bf,MAAAA,WAAW,EACT,gEAH2B;AAI7Ba,MAAAA,KAAK,EAAEpB,MAAM,CAACqB,KAJe;AAK7BE,MAAAA,QAAQ,EAAE,KALmB;AAM7BC,MAAAA,YAAY,EAAE;AANe,KAAD,CApGzB;AA4GLiB,IAAAA,qBAAqB,EAAE5C,eAAe,CAAC;AACrCyB,MAAAA,KAAK,EAAE,yBAD8B;AAErCf,MAAAA,WAAW,EAAE;AAFwB,KAAD,CA5GjC;AAgHLmC,IAAAA,sBAAsB,EAAE7C,eAAe,CAAC;AACtCyB,MAAAA,KAAK,EAAE,kBAD+B;AAEtCf,MAAAA,WAAW,EAAE;AAFyB,KAAD,CAhHlC;AAoHLoC,IAAAA,MAAM,EAAE5C,cAAc,CAAC;AACrByB,MAAAA,YAAY,EAAEoB,OAAO,CAACC,GAAR,CAAYC,mBADL;AAErB3B,MAAAA,QAAQ,EAAE;AAFW,KAAD;AApHjB;AAVgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createColorProp,\n createNumberProp,\n createTextProp,\n GROUPS,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Map View\",\n tag: \"MapView\",\n packageName: \"@draftbit/maps\",\n description: \"A map view\",\n category: COMPONENT_TYPES.media,\n layout: {\n height: \"100%\",\n width: \"100%\",\n },\n props: {\n provider: {\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n editable: true,\n group: GROUPS.basic,\n label: \"Provider\",\n description: \"The maps provider\",\n required: false,\n defaultValue: null,\n options: [\"google\"],\n },\n latitude: createNumberProp({\n label: \"Initial Latitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -90,\n max: 90,\n defaultValue: 37.40241,\n }),\n longitude: createNumberProp({\n label: \"Initial Longitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 6,\n min: -180,\n max: 180,\n defaultValue: -122.12125,\n }),\n latitudeDelta: createNumberProp({\n label: \"Init Latitude Delta\",\n description: \"The latitude delta for the map's initial region\",\n required: false,\n precision: 4,\n defaultValue: 1,\n group: GROUPS.basic,\n }),\n longitudeDelta: createNumberProp({\n label: \"Init Longitude Delta\",\n description: \"The longitude delta for the map's initial region\",\n required: false,\n precision: 4,\n defaultValue: 1,\n group: GROUPS.basic,\n }),\n zoom: createNumberProp({\n label: \"Initial Zoom (Web)\",\n description: \"The initial zoom of the map\",\n required: true,\n precision: 0,\n step: 1,\n defaultValue: 8,\n group: GROUPS.basic,\n }),\n mapType: {\n label: \"Map Type\",\n description: \"The type of map to show\",\n group: GROUPS.basic,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n required: false,\n defaultValue: null,\n options: [\n \"standard\",\n \"satellite\",\n \"hybrid\",\n \"terrain\",\n \"none\",\n \"mutedStandard\",\n ],\n },\n zoomEnabled: createBoolProp({\n label: \"Zoom Enabled\",\n description: \"Whether zooming is enabled (native only)\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n showsCompass: createBoolProp({\n label: \"Shows Compass\",\n description: \"Whether compass is shown\",\n group: GROUPS.basic,\n required: false,\n defaultValue: false,\n }),\n rotateEnabled: createBoolProp({\n label: \"Rotate Enabled\",\n description: \"Whether rotating the map is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Scroll Enabled\",\n description: \"Whether scrolling the map view is enabled\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingEnabled: createBoolProp({\n label: \"Loading Enabled\",\n description:\n \"If true a loading indicator will show while the map is loading\",\n group: GROUPS.basic,\n required: false,\n defaultValue: true,\n }),\n loadingIndicatorColor: createColorProp({\n label: \"Loading Indicator Color\",\n description: \"Color of the loading indicator\",\n }),\n loadingBackgroundColor: createColorProp({\n label: \"Loading BG Color\",\n description: \"Color of the background to show while the map is loading\",\n }),\n apiKey: createTextProp({\n defaultValue: process.env.GOOGLE_MAPS_API_KEY,\n editable: false,\n }),\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["View.ts"],"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","description","category","basic","props","accessible","group","accessibility","label","editable","required","formType","boolean","propType","BOOLEAN","defaultValue","accessibilityLabel","string","STRING","accessibilityHint","accessibilityRole","options","flatArray","accessibilityElementsHidden","accessibilityIgnoresInvertColors","accessibilityLiveRegion","importantForAccessibility","hitSlop","advanced","position","OBJECT","pointerEvents","removeClippedSubviews","collapsable","needsOffscreenAlphaCompositing","renderToHardwareTextureAndroid","shouldRasterizeIOS"],"mappings":"AAAA,SACEA,MADF,EAEEC,eAFF,EAGEC,UAHF,EAIEC,UAJF,QAKO,iBALP;AAOA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,wBAHU;AAIvBC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,KAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAEZ,MAAM,CAACa,aADJ;AAEVR,MAAAA,IAAI,EAAE,YAFI;AAGVS,MAAAA,KAAK,EAAE,YAHG;AAIVP,MAAAA,WAAW,EACT,wHALQ;AAMVQ,MAAAA,QAAQ,EAAE,IANA;AAOVC,MAAAA,QAAQ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BC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,OATH;AAUlBC,MAAAA,YAAY,EAAE;AAVI;AAzMf;AALgB,CAAlB","sourcesContent":["import {\n GROUPS,\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"View\",\n tag: \"View\",\n description: \"A basic View component\",\n category: COMPONENT_TYPES.basic,\n props: {\n accessible: {\n group: GROUPS.accessibility,\n name: \"accessible\",\n label: \"accessible\",\n description:\n \"When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityLabel: {\n group: GROUPS.accessibility,\n name: \"accessibilityLabel\",\n label: \"accessibilityLabel\",\n description:\n \"Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n editable: true,\n required: false,\n defaultValue: null,\n },\n accessibilityHint: {\n group: GROUPS.accessibility,\n name: \"accessibilityHint\",\n label: \"accessibilityHint\",\n description:\n \"An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n accessibilityRole: {\n group: GROUPS.accessibility,\n name: \"accessibilityRole\",\n label: \"accessibilityRole\",\n description:\n \"accessibilityRole communicates the purpose of a component to the user of an assistive technology.accessibilityRole can be one of the following:\\n'none' - Used when the element has no role.\\n'button' - Used when the element should be treated as a button.\\n'link' - Used when the element should be treated as a link.\\n'search' - Used when the text field element should also be treated as a search field.\\n'image' - Used when the element should be treated as an image. Can be combined with button or link, for example.\\n'keyboardkey' - Used when the element acts as a keyboard key.\\n'text' - Used when the element should be treated as static text that cannot change.\\n'adjustable' - Used when an element can be \\\"adjusted\\\" (e.g. a slider).\\n'imagebutton' - Used when the element should be treated as a button and is also an image.\\n'header' - Used when an element acts as a header for a content section (e.g. the title of a navigation bar).\\n'summary' - Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.\\n'alert' - Used when an element contains important text to be presented to the user.\\n'checkbox' - Used when an element represents a checkbox which can be checked, unchecked, or have mixed checked state.\\n'combobox' - Used when an element represents a combo box, which allows the user to select among several choices.\\n'menu' - Used when the component is a menu of choices.\\n'menubar' - Used when a component is a container of multiple menus.\\n'menuitem' - Used to represent an item within a menu.\\n'progressbar' - Used to represent a component which indicates progress of a task.\\n'radio' - Used to represent a radio button.\\n'radiogroup' - Used to represent a group of radio buttons.\\n'scrollbar' - Used to represent a scroll bar.\\n'spinbutton' - Used to represent a button which opens a list of choices.\\n'switch' - Used to represent a switch which can be turned on and off.\\n'tab' - Used to represent a tab.\\n'tablist' - Used to represent a list of tabs.\\n'timer' - Used to represent a timer.\\n'toolbar' - Used to represent a tool bar (a container of action buttons or components).\\n\",\n options: [\n \"none\",\n \"button\",\n \"link\",\n \"search\",\n \"image\",\n \"keyboardkey\",\n \"text\",\n \"adjustable\",\n \"imagebutton\",\n \"header\",\n \"summary\",\n \"alert\",\n \"checkbox\",\n \"combobox\",\n \"menu\",\n \"menubar\",\n \"menuitem\",\n \"progressbar\",\n \"radio\",\n \"radiogroup\",\n \"scrollbar\",\n \"spinbutton\",\n \"switch\",\n \"tab\",\n \"tablist\",\n \"timer\",\n \"toolbar\",\n ],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n accessibilityElementsHidden: {\n group: GROUPS.accessibility,\n name: \"accessibilityElementsHidden\",\n label: \"accessibilityElementsHidden\",\n description:\n \"A value indicating whether the accessibility elements contained within this accessibility element are hidden. Default is false.See the Accessibility guide for more information.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityIgnoresInvertColors: {\n group: GROUPS.accessibility,\n name: \"accessibilityIgnoresInvertColors\",\n label: \"accessibilityIgnoresInvertColors\",\n description:\n \"A value indicating this view should or should not be inverted when color inversion is turned on. A value of true will tell the view to not be inverted even if color inversion is turned on.See the Accessibility guide for more information.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityLiveRegion: {\n group: GROUPS.accessibility,\n name: \"accessibilityLiveRegion\",\n label: \"accessibilityLiveRegion\",\n description:\n \"Indicates to accessibility services whether the user should be notified when this view changes. Works for Android API >= 19 only. Possible values:\\n'none' - Accessibility services should not announce changes to this view.\\n'polite'- Accessibility services should announce changes to this view.\\n'assertive' - Accessibility services should interrupt ongoing speech to immediately announce changes to this view.\\nSee the Android View docs for reference.\",\n options: [\"none\", \"polite\", \"assertive\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n importantForAccessibility: {\n group: GROUPS.accessibility,\n name: \"importantForAccessibility\",\n label: \"importantForAccessibility\",\n defaultValue: null,\n description:\n \"Controls how view is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. Works for Android only.Possible values:\\n'auto' - The system determines whether the view is important for accessibility - default (recommended).\\n'yes' - The view is important for accessibility.\\n'no' - The view is not important for accessibility.\\n'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views.\\nSee the Android importantForAccessibility docs for reference.\",\n options: [\"auto\", \"yes\", \"no\", \"no-hide-descendants\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n hitSlop: {\n group: GROUPS.advanced,\n name: \"hitSlop\",\n label: \"hitSlop\",\n description:\n \"This defines how far a touch event can start away from the view. Typical interface guidelines recommend touch targets that are at least 30 - 40 points/density-independent pixels.For example, if a touchable view has a height of 20 the touchable height can be extended to 40 with hitSlop={{top: 10, bottom: 10, left: 0, right: 0}}\\nThe touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.\\n\",\n editable: true,\n required: false,\n formType: FORM_TYPES.position,\n propType: PROP_TYPES.OBJECT,\n defaultValue: null,\n },\n pointerEvents: {\n group: GROUPS.advanced,\n name: \"pointerEvents\",\n label: \"pointerEvents\",\n description:\n \"Controls whether the View can be the target of touch events.\\n'auto': The View can be the target of touch events.\\n'none': The View is never the target of touch events.\\n'box-none': The View is never the target of touch events but its subviews can be. It behaves like if the view had the following classes in CSS:\\n.box-none {\\n pointer-events: none;\\n}\\n.box-none * {\\n pointer-events: auto;\\n}\\n\\n'box-only': The view can be the target of touch events but its subviews cannot be. It behaves like if the view had the following classes in CSS:\\n.box-only {\\n pointer-events: auto;\\n}\\n.box-only * {\\n pointer-events: none;\\n}\\n\\nSince pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform.\\n\",\n options: [\"auto\", \"none\", \"box-none\", \"box-only\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"auto\",\n },\n removeClippedSubviews: {\n group: GROUPS.advanced,\n name: \"removeClippedSubviews\",\n label: \"removeClippedSubviews\",\n description:\n \"This is a reserved performance property exposed by RCTView and is useful for scrolling content when there are many subviews, most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. The subviews must also have overflow: hidden, as should the containing view (or one of its superviews).\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n collapsable: {\n group: GROUPS.advanced,\n name: \"collapsable\",\n label: \"collapsable\",\n description:\n \"Views that are only used to layout their children or otherwise don't draw anything may be automatically removed from the native hierarchy as an optimization. Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n needsOffscreenAlphaCompositing: {\n group: GROUPS.advanced,\n name: \"needsOffscreenAlphaCompositing\",\n label: \"needsOffscreenAlphaCompositing\",\n description:\n \"Whether this View needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. The default (false) falls back to drawing the component and its children with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. This default may be noticeable and undesired in the case where the View you are setting an opacity on has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background).Rendering offscreen to preserve correct alpha behavior is extremely expensive and hard to debug for non-native developers, which is why it is not turned on by default. If you do need to enable this property for an animation, consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). If that property is enabled, this View will be rendered off-screen once, saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n renderToHardwareTextureAndroid: {\n group: GROUPS.advanced,\n name: \"renderToHardwareTextureAndroid\",\n label: \"renderToHardwareTextureAndroid\",\n description:\n \"Whether this View should render itself (and all of its children) into a single hardware texture on the GPU.On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can be re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n shouldRasterizeIOS: {\n group: GROUPS.advanced,\n name: \"shouldRasterizeIOS\",\n label: \"shouldRasterizeIOS\",\n description:\n \"Whether this View should be rendered as a bitmap before compositing.On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view and quickly composite it during each frame.Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. Test and measure when using this property.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["View.ts"],"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","description","category","basic","props","accessible","group","accessibility","label","editable","required","formType","boolean","propType","BOOLEAN","defaultValue","accessibilityLabel","string","STRING","accessibilityHint","accessibilityRole","options","flatArray","accessibilityElementsHidden","accessibilityIgnoresInvertColors","accessibilityLiveRegion","importantForAccessibility","hitSlop","advanced","position","OBJECT","pointerEvents","removeClippedSubviews","collapsable","needsOffscreenAlphaCompositing","renderToHardwareTextureAndroid","shouldRasterizeIOS"],"mappings":"AAAA,SACEA,MADF,EAEEC,eAFF,EAGEC,UAHF,EAIEC,UAJF,QAKO,iBALP;AAOA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,wBAHU;AAIvBC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,KAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAEZ,MAAM,CAACa,aADJ;AAEVR,MAAAA,IAAI,EAAE,YAFI;AAGVS,MAAAA,KAAK,EAAE,YAHG;AAIVP,MAAAA,WAAW,EACT,wHALQ;AAMVQ,MAAAA,QAAQ,EAAE,IANA;AAOVC,MAAAA,QAAQ,EAAE,KAPA;AAQVC,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,OARX;AASVC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,OATX;AAUVC,MAAAA,YAAY,EAAE;AAVJ,KADP;AAaLC,IAAAA,kBAAkB,EAAE;AAClBV,MAAAA,KAAK,EAAEZ,MAAM,CAAC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tag: \"View\",\n description: \"A basic View component\",\n category: COMPONENT_TYPES.basic,\n props: {\n accessible: {\n group: GROUPS.accessibility,\n name: \"accessible\",\n label: \"accessible\",\n description:\n \"When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityLabel: {\n group: GROUPS.accessibility,\n name: \"accessibilityLabel\",\n label: \"accessibilityLabel\",\n description:\n \"Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n editable: true,\n required: false,\n defaultValue: null,\n },\n accessibilityHint: {\n group: GROUPS.accessibility,\n name: \"accessibilityHint\",\n label: \"accessibilityHint\",\n description:\n \"An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n accessibilityRole: {\n group: GROUPS.accessibility,\n name: \"accessibilityRole\",\n label: \"accessibilityRole\",\n description:\n \"accessibilityRole communicates the purpose of a component to the user of an assistive technology.accessibilityRole can be one of the following:\\n'none' - Used when the element has no role.\\n'button' - Used when the element should be treated as a button.\\n'link' - Used when the element should be treated as a link.\\n'search' - Used when the text field element should also be treated as a search field.\\n'image' - Used when the element should be treated as an image. Can be combined with button or link, for example.\\n'keyboardkey' - Used when the element acts as a keyboard key.\\n'text' - Used when the element should be treated as static text that cannot change.\\n'adjustable' - Used when an element can be \\\"adjusted\\\" (e.g. a slider).\\n'imagebutton' - Used when the element should be treated as a button and is also an image.\\n'header' - Used when an element acts as a header for a content section (e.g. the title of a navigation bar).\\n'summary' - Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.\\n'alert' - Used when an element contains important text to be presented to the user.\\n'checkbox' - Used when an element represents a checkbox which can be checked, unchecked, or have mixed checked state.\\n'combobox' - Used when an element represents a combo box, which allows the user to select among several choices.\\n'menu' - Used when the component is a menu of choices.\\n'menubar' - Used when a component is a container of multiple menus.\\n'menuitem' - Used to represent an item within a menu.\\n'progressbar' - Used to represent a component which indicates progress of a task.\\n'radio' - Used to represent a radio button.\\n'radiogroup' - Used to represent a group of radio buttons.\\n'scrollbar' - Used to represent a scroll bar.\\n'spinbutton' - Used to represent a button which opens a list of choices.\\n'switch' - Used to represent a switch which can be turned on and off.\\n'tab' - Used to represent a tab.\\n'tablist' - Used to represent a list of tabs.\\n'timer' - Used to represent a timer.\\n'toolbar' - Used to represent a tool bar (a container of action buttons or components).\\n\",\n options: [\n \"none\",\n \"button\",\n \"link\",\n \"search\",\n \"image\",\n \"keyboardkey\",\n \"text\",\n \"adjustable\",\n \"imagebutton\",\n \"header\",\n \"summary\",\n \"alert\",\n \"checkbox\",\n \"combobox\",\n \"menu\",\n \"menubar\",\n \"menuitem\",\n \"progressbar\",\n \"radio\",\n \"radiogroup\",\n \"scrollbar\",\n \"spinbutton\",\n \"switch\",\n \"tab\",\n \"tablist\",\n \"timer\",\n \"toolbar\",\n ],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n accessibilityElementsHidden: {\n group: GROUPS.accessibility,\n name: \"accessibilityElementsHidden\",\n label: \"accessibilityElementsHidden\",\n description:\n \"A value indicating whether the accessibility elements contained within this accessibility element are hidden. Default is false.See the Accessibility guide for more information.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityIgnoresInvertColors: {\n group: GROUPS.accessibility,\n name: \"accessibilityIgnoresInvertColors\",\n label: \"accessibilityIgnoresInvertColors\",\n description:\n \"A value indicating this view should or should not be inverted when color inversion is turned on. A value of true will tell the view to not be inverted even if color inversion is turned on.See the Accessibility guide for more information.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n accessibilityLiveRegion: {\n group: GROUPS.accessibility,\n name: \"accessibilityLiveRegion\",\n label: \"accessibilityLiveRegion\",\n description:\n \"Indicates to accessibility services whether the user should be notified when this view changes. Works for Android API >= 19 only. Possible values:\\n'none' - Accessibility services should not announce changes to this view.\\n'polite'- Accessibility services should announce changes to this view.\\n'assertive' - Accessibility services should interrupt ongoing speech to immediately announce changes to this view.\\nSee the Android View docs for reference.\",\n options: [\"none\", \"polite\", \"assertive\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n importantForAccessibility: {\n group: GROUPS.accessibility,\n name: \"importantForAccessibility\",\n label: \"importantForAccessibility\",\n defaultValue: null,\n description:\n \"Controls how view is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. Works for Android only.Possible values:\\n'auto' - The system determines whether the view is important for accessibility - default (recommended).\\n'yes' - The view is important for accessibility.\\n'no' - The view is not important for accessibility.\\n'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views.\\nSee the Android importantForAccessibility docs for reference.\",\n options: [\"auto\", \"yes\", \"no\", \"no-hide-descendants\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n hitSlop: {\n group: GROUPS.advanced,\n name: \"hitSlop\",\n label: \"hitSlop\",\n description:\n \"This defines how far a touch event can start away from the view. Typical interface guidelines recommend touch targets that are at least 30 - 40 points/density-independent pixels.For example, if a touchable view has a height of 20 the touchable height can be extended to 40 with hitSlop={{top: 10, bottom: 10, left: 0, right: 0}}\\nThe touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.\\n\",\n editable: true,\n required: false,\n formType: FORM_TYPES.position,\n propType: PROP_TYPES.OBJECT,\n defaultValue: null,\n },\n pointerEvents: {\n group: GROUPS.advanced,\n name: \"pointerEvents\",\n label: \"pointerEvents\",\n description:\n \"Controls whether the View can be the target of touch events.\\n'auto': The View can be the target of touch events.\\n'none': The View is never the target of touch events.\\n'box-none': The View is never the target of touch events but its subviews can be. It behaves like if the view had the following classes in CSS:\\n.box-none {\\n pointer-events: none;\\n}\\n.box-none * {\\n pointer-events: auto;\\n}\\n\\n'box-only': The view can be the target of touch events but its subviews cannot be. It behaves like if the view had the following classes in CSS:\\n.box-only {\\n pointer-events: auto;\\n}\\n.box-only * {\\n pointer-events: none;\\n}\\n\\nSince pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform.\\n\",\n options: [\"auto\", \"none\", \"box-none\", \"box-only\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n removeClippedSubviews: {\n group: GROUPS.advanced,\n name: \"removeClippedSubviews\",\n label: \"removeClippedSubviews\",\n description:\n \"This is a reserved performance property exposed by RCTView and is useful for scrolling content when there are many subviews, most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. The subviews must also have overflow: hidden, as should the containing view (or one of its superviews).\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n collapsable: {\n group: GROUPS.advanced,\n name: \"collapsable\",\n label: \"collapsable\",\n description:\n \"Views that are only used to layout their children or otherwise don't draw anything may be automatically removed from the native hierarchy as an optimization. Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n needsOffscreenAlphaCompositing: {\n group: GROUPS.advanced,\n name: \"needsOffscreenAlphaCompositing\",\n label: \"needsOffscreenAlphaCompositing\",\n description:\n \"Whether this View needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. The default (false) falls back to drawing the component and its children with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. This default may be noticeable and undesired in the case where the View you are setting an opacity on has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background).Rendering offscreen to preserve correct alpha behavior is extremely expensive and hard to debug for non-native developers, which is why it is not turned on by default. If you do need to enable this property for an animation, consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). If that property is enabled, this View will be rendered off-screen once, saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n renderToHardwareTextureAndroid: {\n group: GROUPS.advanced,\n name: \"renderToHardwareTextureAndroid\",\n label: \"renderToHardwareTextureAndroid\",\n description:\n \"Whether this View should render itself (and all of its children) into a single hardware texture on the GPU.On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can be re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n shouldRasterizeIOS: {\n group: GROUPS.advanced,\n name: \"shouldRasterizeIOS\",\n label: \"shouldRasterizeIOS\",\n description:\n \"Whether this View should be rendered as a bitmap before compositing.On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view and quickly composite it during each frame.Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. Test and measure when using this property.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: null,\n },\n },\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.6.
|
|
3
|
+
"version": "43.6.1-3d1384.1+3d13849e",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^43.6.0
|
|
44
|
+
"@draftbit/types": "^43.6.0",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.1.7",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "3d13849eb9e0595e83ff88488b2c402881d5897e"
|
|
84
84
|
}
|
package/src/Provider.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ThemeProvider } from "./theming";
|
|
3
|
+
import PortalHost from "./components/Portal/PortalHost";
|
|
4
|
+
export default class Provider extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
return (React.createElement(PortalHost, null,
|
|
7
|
+
React.createElement(ThemeProvider, { theme: this.props.theme }, this.props.children)));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, StyleSheet, Pressable, } from "react-native";
|
|
3
|
+
import Text from "../Text";
|
|
4
|
+
import { withTheme } from "../../theming";
|
|
5
|
+
import { extractStyles } from "../../utilities";
|
|
6
|
+
const AccordionGroup = ({ label, expanded: expandedProp = false, openColor, closedColor, caretColor: caretColorProp, caretSize = 24, icon, iconSize = 24, style, children, theme, Icon, }) => {
|
|
7
|
+
const [expanded, setExpanded] = React.useState(expandedProp);
|
|
8
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
9
|
+
const expandedColor = openColor || theme.colors.primary;
|
|
10
|
+
const collapsedColor = closedColor || theme.colors.primary;
|
|
11
|
+
const labelColor = expanded ? expandedColor : collapsedColor;
|
|
12
|
+
const caretColor = caretColorProp || labelColor;
|
|
13
|
+
const handlePressAction = () => {
|
|
14
|
+
setExpanded(!expanded);
|
|
15
|
+
};
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement(Pressable, { style: [styles.row, viewStyles], onPress: handlePressAction, accessibilityRole: "button" },
|
|
18
|
+
icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
|
|
19
|
+
React.createElement(View, { style: styles.content },
|
|
20
|
+
React.createElement(Text, { selectable: false, style: [
|
|
21
|
+
textStyles,
|
|
22
|
+
{
|
|
23
|
+
color: labelColor,
|
|
24
|
+
},
|
|
25
|
+
] }, label)),
|
|
26
|
+
React.createElement(Icon, { name: expanded
|
|
27
|
+
? "MaterialIcons/keyboard-arrow-up"
|
|
28
|
+
: "MaterialIcons/keyboard-arrow-down", color: caretColor, size: caretSize })),
|
|
29
|
+
expanded ? children : null));
|
|
30
|
+
};
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
row: {
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
flex: 1,
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
marginRight: 8,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
export default withTheme(AccordionGroup);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Pressable, StyleSheet, View, } from "react-native";
|
|
3
|
+
import Text from "../Text";
|
|
4
|
+
import { extractStyles } from "../../utilities";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
const AccordionItem = ({ Icon, icon, label, style, iconColor, theme, ...rest }) => {
|
|
7
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
8
|
+
return (React.createElement(Pressable, { style: [styles.container, viewStyles], ...rest },
|
|
9
|
+
React.createElement(View, { style: styles.row },
|
|
10
|
+
icon ? (React.createElement(Icon, { name: icon, size: 24, color: iconColor || theme.colors.primary })) : null,
|
|
11
|
+
React.createElement(View, { style: [styles.item, styles.content] },
|
|
12
|
+
React.createElement(Text, { selectable: false, style: textStyles }, label)))));
|
|
13
|
+
};
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
container: {
|
|
16
|
+
padding: 8,
|
|
17
|
+
},
|
|
18
|
+
row: {
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
paddingLeft: 8,
|
|
22
|
+
},
|
|
23
|
+
item: {
|
|
24
|
+
marginVertical: 6,
|
|
25
|
+
paddingLeft: 8,
|
|
26
|
+
},
|
|
27
|
+
content: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
export default withTheme(AccordionItem);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import Portal from "../Portal/Portal";
|
|
4
|
+
import Touchable from "../Touchable";
|
|
5
|
+
import ActionSheetCancel from "./ActionSheetCancel";
|
|
6
|
+
const ActionSheet = ({ visible = false, onClose, children }) => {
|
|
7
|
+
return visible ? (React.createElement(Portal, null,
|
|
8
|
+
React.createElement(Touchable, { style: styles.wrapper, onPress: onClose },
|
|
9
|
+
React.createElement(View, { style: styles.overlay }),
|
|
10
|
+
React.createElement(View, { style: styles.groupWrapper },
|
|
11
|
+
React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child?.type !== ActionSheetCancel)),
|
|
12
|
+
React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child.type === ActionSheetCancel)))))) : (React.createElement(React.Fragment, null));
|
|
13
|
+
};
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
wrapper: {
|
|
16
|
+
flex: 1,
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
},
|
|
20
|
+
overlay: {
|
|
21
|
+
position: "absolute",
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
right: 0,
|
|
25
|
+
bottom: 0,
|
|
26
|
+
backgroundColor: "#000000",
|
|
27
|
+
opacity: 0.3,
|
|
28
|
+
},
|
|
29
|
+
groupWrapper: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
justifyContent: "flex-end",
|
|
33
|
+
display: "flex",
|
|
34
|
+
marginBottom: 25,
|
|
35
|
+
},
|
|
36
|
+
group: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
borderRadius: 10,
|
|
40
|
+
marginHorizontal: 7,
|
|
41
|
+
marginVertical: 2.5,
|
|
42
|
+
overflow: "hidden",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ActionSheetItem from "./ActionSheetItem";
|
|
3
|
+
const ActionSheetCancel = ({ label = "Cancel", color, style, onPress, }) => {
|
|
4
|
+
return (React.createElement(ActionSheetItem, { label: label, color: color || "#FF453A", style: [style], onPress: onPress }));
|
|
5
|
+
};
|
|
6
|
+
export default ActionSheetCancel;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, StyleSheet, TouchableOpacity, } from "react-native";
|
|
3
|
+
import { extractStyles } from "../../utilities";
|
|
4
|
+
const ActionSheetItem = ({ label, style, color, onPress }) => {
|
|
5
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
6
|
+
return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, style: [styles.wrapper, viewStyles], onPress: onPress },
|
|
7
|
+
React.createElement(Text, { style: [styles.label, textStyles, { color }] }, label)));
|
|
8
|
+
};
|
|
9
|
+
const styles = StyleSheet.create({
|
|
10
|
+
wrapper: {
|
|
11
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
12
|
+
borderBottomColor: "#CCCCCC",
|
|
13
|
+
backgroundColor: "#F1F1F1",
|
|
14
|
+
minHeight: 50,
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
display: "flex",
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
fontSize: 16,
|
|
21
|
+
textAlign: "center",
|
|
22
|
+
color: "#0A84FF",
|
|
23
|
+
fontWeight: "500",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
paddingHorizontal: 20,
|
|
26
|
+
paddingVertical: 10,
|
|
27
|
+
alignSelf: "center",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export default ActionSheetItem;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Animated, Easing, } from "react-native";
|
|
3
|
+
import CircularProgress from "./CircularProgress";
|
|
4
|
+
const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
|
|
5
|
+
const AnimatedCircularProgress = ({ duration = 500, easing = Easing.out(Easing.ease), fill, prefill = 0, useNativeDriver = false, tintColorSecondary, onAnimationComplete, tintColor = "black", ...other }) => {
|
|
6
|
+
const [fillAnimation] = React.useState(new Animated.Value(prefill));
|
|
7
|
+
const animate = React.useCallback((toVal = -1, dur, ease) => {
|
|
8
|
+
const toValue = toVal >= 0 ? toVal : fill;
|
|
9
|
+
const dura = dur || duration;
|
|
10
|
+
const eas = ease || easing;
|
|
11
|
+
const useNative = useNativeDriver;
|
|
12
|
+
const anim = Animated.timing(fillAnimation, {
|
|
13
|
+
useNativeDriver: useNative,
|
|
14
|
+
toValue,
|
|
15
|
+
easing: eas,
|
|
16
|
+
duration: dura,
|
|
17
|
+
});
|
|
18
|
+
anim.start(onAnimationComplete);
|
|
19
|
+
return anim;
|
|
20
|
+
}, [
|
|
21
|
+
duration,
|
|
22
|
+
easing,
|
|
23
|
+
fill,
|
|
24
|
+
useNativeDriver,
|
|
25
|
+
fillAnimation,
|
|
26
|
+
onAnimationComplete,
|
|
27
|
+
]);
|
|
28
|
+
const animateColor = () => {
|
|
29
|
+
if (!tintColorSecondary) {
|
|
30
|
+
return tintColor;
|
|
31
|
+
}
|
|
32
|
+
const tintAnimation = fillAnimation.interpolate({
|
|
33
|
+
inputRange: [0, 100],
|
|
34
|
+
outputRange: [tintColor, tintColorSecondary],
|
|
35
|
+
});
|
|
36
|
+
return tintAnimation;
|
|
37
|
+
};
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
animate();
|
|
40
|
+
}, [fill, animate]);
|
|
41
|
+
return (React.createElement(AnimatedProgress, { ...other, style: other.style, childrenContainerStyle: other.childrenContainerStyle, fill: fillAnimation, tintColor: animateColor() }));
|
|
42
|
+
};
|
|
43
|
+
export default AnimatedCircularProgress;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet, } from "react-native";
|
|
3
|
+
const AspectRatio = (props) => {
|
|
4
|
+
const [layout, setLayout] = React.useState(null);
|
|
5
|
+
const { aspectRatio = 1, ...inputStyle } = StyleSheet.flatten(props.style) || {};
|
|
6
|
+
const style = [inputStyle, { aspectRatio }];
|
|
7
|
+
if (layout) {
|
|
8
|
+
const { width = 0, height = 0 } = layout;
|
|
9
|
+
if (width === 0) {
|
|
10
|
+
style.push({ width: height * (1 / aspectRatio), height });
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
style.push({ width, height: width * (1 / aspectRatio) });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return (React.createElement(View, { ...props, style: style, onLayout: ({ nativeEvent: { layout: l } }) => setLayout(l) }, props.children));
|
|
17
|
+
};
|
|
18
|
+
export default AspectRatio;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import Touchable from "./Touchable";
|
|
4
|
+
import CircleImage from "./CircleImage";
|
|
5
|
+
import { withTheme } from "../theming";
|
|
6
|
+
const AvatarEdit = ({ Icon, image, size = 80, onPress = () => { }, style, theme, ...rest }) => {
|
|
7
|
+
const colorStyles = {
|
|
8
|
+
editBackgroundColor: theme.colors.primary,
|
|
9
|
+
editIconColor: theme.colors.surface,
|
|
10
|
+
editBorderColor: theme.colors.surface,
|
|
11
|
+
};
|
|
12
|
+
const dimensions = {
|
|
13
|
+
width: size,
|
|
14
|
+
height: size,
|
|
15
|
+
};
|
|
16
|
+
return (React.createElement(View, { style: [style, dimensions], ...rest },
|
|
17
|
+
React.createElement(Touchable, { onPress: onPress },
|
|
18
|
+
React.createElement(CircleImage, { source: image, size: size }),
|
|
19
|
+
React.createElement(View, { style: {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
top: -3,
|
|
22
|
+
right: -3,
|
|
23
|
+
borderColor: colorStyles.editBorderColor,
|
|
24
|
+
backgroundColor: colorStyles.editBackgroundColor,
|
|
25
|
+
borderRadius: size * (3 / 16),
|
|
26
|
+
padding: size * (3 / 32),
|
|
27
|
+
} },
|
|
28
|
+
React.createElement(Icon, { name: "MaterialIcons/edit", color: colorStyles.editIconColor, size: size * (3 / 16) })))));
|
|
29
|
+
};
|
|
30
|
+
export default withTheme(AvatarEdit);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button, Text, View, StyleSheet, Animated, } from "react-native";
|
|
3
|
+
import Surface from "./Surface";
|
|
4
|
+
import shadow from "../styles/shadow";
|
|
5
|
+
import { withTheme } from "../theming";
|
|
6
|
+
const ELEVATION = 1;
|
|
7
|
+
const DEFAULT_MAX_WIDTH = 960;
|
|
8
|
+
const Banner = ({ initiallyVisible = true, dismissable = true, icon, buttonColor, content, contentStyle, style, theme, Icon, ...rest }) => {
|
|
9
|
+
const [visible, setVisible] = React.useState(initiallyVisible);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (initiallyVisible) {
|
|
12
|
+
setVisible(true);
|
|
13
|
+
}
|
|
14
|
+
}, [initiallyVisible]);
|
|
15
|
+
const { current: position } = React.useRef(new Animated.Value(visible ? 1 : 0));
|
|
16
|
+
const [layout, setLayout] = React.useState({
|
|
17
|
+
height: 0,
|
|
18
|
+
measured: false,
|
|
19
|
+
});
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (visible) {
|
|
22
|
+
// show
|
|
23
|
+
Animated.timing(position, {
|
|
24
|
+
duration: 250,
|
|
25
|
+
toValue: 1,
|
|
26
|
+
useNativeDriver: false,
|
|
27
|
+
}).start();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// hide
|
|
31
|
+
Animated.timing(position, {
|
|
32
|
+
duration: 200,
|
|
33
|
+
toValue: 0,
|
|
34
|
+
useNativeDriver: false,
|
|
35
|
+
}).start();
|
|
36
|
+
}
|
|
37
|
+
}, [visible, position]);
|
|
38
|
+
const handleLayout = ({ nativeEvent }) => {
|
|
39
|
+
const { height } = nativeEvent.layout;
|
|
40
|
+
setLayout({ height, measured: true });
|
|
41
|
+
};
|
|
42
|
+
// The banner animation has 2 parts:
|
|
43
|
+
// 1. Blank spacer element which animates its height to move the content
|
|
44
|
+
// 2. Actual banner which animates its translateY
|
|
45
|
+
// In initial render, we position everything normally and measure the height of the banner
|
|
46
|
+
// Once we have the height, we apply the height to the spacer and switch the banner to position: absolute
|
|
47
|
+
// We need this because we need to move the content below as if banner's height was being animated
|
|
48
|
+
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
49
|
+
const height = Animated.multiply(position, layout.height);
|
|
50
|
+
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
51
|
+
return (React.createElement(Surface, { ...rest, style: [styles.container, shadow(ELEVATION), style] },
|
|
52
|
+
React.createElement(View, { style: [styles.wrapper, contentStyle] },
|
|
53
|
+
React.createElement(Animated.View, { style: { height } }),
|
|
54
|
+
React.createElement(Animated.View, { onLayout: handleLayout, style: [
|
|
55
|
+
layout.measured || !visible
|
|
56
|
+
? // If we have measured banner's height or it's invisible,
|
|
57
|
+
// Position it absolutely, the layout will be taken care of the spacer
|
|
58
|
+
[styles.absolute, { transform: [{ translateY }] }]
|
|
59
|
+
: // Otherwise position it normally
|
|
60
|
+
null,
|
|
61
|
+
!layout.measured && !visible
|
|
62
|
+
? // If we haven't measured banner's height yet and it's invisible,
|
|
63
|
+
// hide it with opacity: 0 so user doesn't see it
|
|
64
|
+
{ opacity: 0 }
|
|
65
|
+
: null,
|
|
66
|
+
] },
|
|
67
|
+
React.createElement(View, { style: [styles.content, { marginBottom: dismissable ? 0 : 16 }] },
|
|
68
|
+
icon ? (React.createElement(View, { style: styles.icon },
|
|
69
|
+
React.createElement(Icon, { name: icon, size: 40 }))) : null,
|
|
70
|
+
React.createElement(Text, { style: [styles.message, { color: theme.colors.text }], accessibilityLiveRegion: visible ? "polite" : "none", accessibilityRole: "alert" }, content)),
|
|
71
|
+
dismissable ? (React.createElement(View, { style: styles.actions },
|
|
72
|
+
React.createElement(Button, { color: buttonColor || theme.colors.primary, title: "Close", onPress: () => setVisible(false) }))) : null))));
|
|
73
|
+
};
|
|
74
|
+
const styles = StyleSheet.create({
|
|
75
|
+
container: {
|
|
76
|
+
elevation: ELEVATION,
|
|
77
|
+
},
|
|
78
|
+
wrapper: {
|
|
79
|
+
overflow: "hidden",
|
|
80
|
+
alignSelf: "center",
|
|
81
|
+
width: "100%",
|
|
82
|
+
maxWidth: DEFAULT_MAX_WIDTH,
|
|
83
|
+
},
|
|
84
|
+
absolute: {
|
|
85
|
+
position: "absolute",
|
|
86
|
+
top: 0,
|
|
87
|
+
width: "100%",
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
justifyContent: "flex-start",
|
|
92
|
+
marginHorizontal: 8,
|
|
93
|
+
marginTop: 16,
|
|
94
|
+
marginBottom: 0,
|
|
95
|
+
},
|
|
96
|
+
icon: {
|
|
97
|
+
margin: 8,
|
|
98
|
+
},
|
|
99
|
+
message: {
|
|
100
|
+
flex: 1,
|
|
101
|
+
margin: 8,
|
|
102
|
+
},
|
|
103
|
+
actions: {
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
justifyContent: "flex-end",
|
|
106
|
+
margin: 8,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
export default withTheme(Banner);
|