├── packages ├── launcher │ ├── README.md │ ├── src │ │ ├── tailwind.css │ │ ├── components │ │ │ ├── TableViewSeciton.vue │ │ │ ├── TableViewCell.vue │ │ │ └── NavigationBar.vue │ │ ├── env.d.ts │ │ ├── main.ts │ │ ├── App.vue │ │ ├── app.json │ │ └── utils.ts │ ├── postcss.config.js │ ├── iOS │ │ ├── Launcher │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── LOGO.png │ │ │ │ │ └── Contents.json │ │ │ │ └── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ ├── app-service.evpkg │ │ │ ├── Codable+Extension.swift │ │ │ └── AppDelegate.swift │ │ ├── Launcher.xcodeproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Launcher.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Podfile │ ├── tsconfig.node.json │ ├── vite.config.ts │ ├── tailwind.config.js │ ├── package.json │ └── tsconfig.json ├── webview │ ├── src │ │ ├── element │ │ │ ├── components │ │ │ │ ├── form │ │ │ │ │ ├── Form.less │ │ │ │ │ └── index.ts │ │ │ │ ├── text │ │ │ │ │ ├── Text.less │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Text.tsx │ │ │ │ ├── view │ │ │ │ │ ├── View.less │ │ │ │ │ ├── index.ts │ │ │ │ │ └── View.tsx │ │ │ │ ├── picker │ │ │ │ │ ├── Picker.less │ │ │ │ │ └── index.ts │ │ │ │ ├── label │ │ │ │ │ └── index.ts │ │ │ │ ├── radio-group │ │ │ │ │ ├── RadioGroup.less │ │ │ │ │ └── index.ts │ │ │ │ ├── checkbox-group │ │ │ │ │ ├── CheckboxGroup.less │ │ │ │ │ └── index.ts │ │ │ │ ├── map │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Map.less │ │ │ │ ├── Icon │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Icon.tsx │ │ │ │ ├── Image │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Image.less │ │ │ │ ├── input │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Input.less │ │ │ │ ├── radio │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Radio.less │ │ │ │ ├── video │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── VideoButton │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── VideoButton.tsx │ │ │ │ │ ├── VideoProgress │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── VideoProgress.less │ │ │ │ │ └── VideoScreenBrightness │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── VideoScreenBrightness.tsx │ │ │ │ ├── Button │ │ │ │ │ └── index.ts │ │ │ │ ├── camera │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Camera.less │ │ │ │ ├── canvas │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Canvas.less │ │ │ │ ├── slider │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Slider.less │ │ │ │ ├── swiper │ │ │ │ │ └── index.ts │ │ │ │ ├── switch │ │ │ │ │ └── index.ts │ │ │ │ ├── loading │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Loading.tsx │ │ │ │ │ └── Loading.less │ │ │ │ ├── navigator │ │ │ │ │ ├── Navigator.less │ │ │ │ │ └── index.ts │ │ │ │ ├── checkbox │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Checkbox.less │ │ │ │ ├── progress │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Progress.less │ │ │ │ ├── textarea │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Textarea.less │ │ │ │ ├── input-html │ │ │ │ │ ├── index.ts │ │ │ │ │ └── InputHTML.less │ │ │ │ ├── picker-view │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── PickerView.less │ │ │ │ │ └── define.ts │ │ │ │ ├── scroll-view │ │ │ │ │ ├── index.ts │ │ │ │ │ └── ScrollView.less │ │ │ │ ├── swiper-item │ │ │ │ │ ├── index.ts │ │ │ │ │ └── SwiperItem.less │ │ │ │ ├── movable-area │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── MovableArea.less │ │ │ │ │ ├── constant.ts │ │ │ │ │ └── MovableArea.tsx │ │ │ │ ├── movable-view │ │ │ │ │ ├── index.ts │ │ │ │ │ └── MovableView.less │ │ │ │ ├── picker-view-column │ │ │ │ │ └── index.ts │ │ │ │ ├── Swiper │ │ │ │ │ └── constant.ts │ │ │ │ ├── Radio │ │ │ │ │ └── constant.ts │ │ │ │ └── Checkbox │ │ │ │ │ └── constant.ts │ │ │ ├── composables │ │ │ │ └── useResize.ts │ │ │ ├── directive │ │ │ │ └── tap.ts │ │ │ └── utils │ │ │ │ └── index.ts │ │ ├── env.d.ts │ │ ├── bridge │ │ │ ├── bridge.ts │ │ │ ├── api │ │ │ │ ├── image.ts │ │ │ │ ├── context.ts │ │ │ │ ├── scroll.ts │ │ │ │ ├── canvas.ts │ │ │ │ ├── font.ts │ │ │ │ └── navigator.ts │ │ │ └── index.ts │ │ ├── index.html │ │ └── dom │ │ │ └── vnode.ts │ ├── postcss.config.js │ └── global.d.ts ├── cli │ ├── bin │ │ └── evoker.js │ ├── vite.config.ts │ └── src │ │ ├── index.ts │ │ └── plugins │ │ └── app.ts ├── example │ ├── src │ │ ├── tailwind.css │ │ ├── assets │ │ │ ├── car.png │ │ │ ├── icon_API.png │ │ │ ├── kind │ │ │ │ ├── api.png │ │ │ │ ├── form.png │ │ │ │ ├── logo.png │ │ │ │ ├── map.png │ │ │ │ ├── nav.png │ │ │ │ ├── open.png │ │ │ │ ├── page.png │ │ │ │ ├── view.png │ │ │ │ ├── canvas.png │ │ │ │ ├── device.png │ │ │ │ ├── media.png │ │ │ │ ├── night.png │ │ │ │ ├── worker.png │ │ │ │ ├── api_dark.png │ │ │ │ ├── content.png │ │ │ │ ├── daytime.png │ │ │ │ ├── feedback.png │ │ │ │ ├── form_dark.png │ │ │ │ ├── framework.png │ │ │ │ ├── location.png │ │ │ │ ├── map_dark.png │ │ │ │ ├── nav_dark.png │ │ │ │ ├── network.png │ │ │ │ ├── open_dark.png │ │ │ │ ├── page_dark.png │ │ │ │ ├── storage.png │ │ │ │ ├── view_dark.png │ │ │ │ ├── canvas_dark.png │ │ │ │ ├── device_dark.png │ │ │ │ ├── media_dark.png │ │ │ │ ├── performance.png │ │ │ │ ├── worker_dark.png │ │ │ │ ├── content_dark.png │ │ │ │ ├── feedback_dark.png │ │ │ │ ├── framework_dark.png │ │ │ │ ├── location_dark.png │ │ │ │ ├── network_dark.png │ │ │ │ ├── obstacle-free.png │ │ │ │ ├── storage_dark.png │ │ │ │ ├── performance_dark.png │ │ │ │ └── obstacle-free_dark.png │ │ │ ├── icon_API_HL.png │ │ │ ├── icon_component.png │ │ │ └── icon_component_HL.png │ │ ├── components │ │ │ ├── NCellGroup.vue │ │ │ ├── NTopic.vue │ │ │ ├── NCell.vue │ │ │ ├── VModelTest.vue │ │ │ └── NObject.vue │ │ ├── env.d.ts │ │ ├── pages │ │ │ ├── API │ │ │ │ ├── Vibrate.vue │ │ │ │ ├── ScanCode.vue │ │ │ │ ├── NavigationBarLoading.vue │ │ │ │ ├── PageScroll.vue │ │ │ │ ├── GetNetworkType.vue │ │ │ │ ├── Login.vue │ │ │ │ ├── SetTitle.vue │ │ │ │ ├── PullDownRefresh.vue │ │ │ │ ├── CaptureScreen.vue │ │ │ │ ├── MakePhoneCall.vue │ │ │ │ ├── GetBatteryInfo.vue │ │ │ │ ├── ActionSheet.vue │ │ │ │ ├── Modal.vue │ │ │ │ ├── OnNetworkStatusChange.vue │ │ │ │ ├── Animation.vue │ │ │ │ ├── VModel.vue │ │ │ │ ├── Navigator.vue │ │ │ │ ├── Clipboard.vue │ │ │ │ ├── GetSystemInfo.vue │ │ │ │ ├── IntersectionObserver.vue │ │ │ │ ├── Toast.vue │ │ │ │ ├── ScreenBrightness.vue │ │ │ │ ├── LoadFontFace.vue │ │ │ │ ├── DownloadFile.vue │ │ │ │ ├── GetLocation.vue │ │ │ │ ├── Setting.vue │ │ │ │ ├── GetUserInfo.vue │ │ │ │ └── Request.vue │ │ │ └── Component │ │ │ │ ├── Navigator.vue │ │ │ │ ├── Slider.vue │ │ │ │ ├── Progress.vue │ │ │ │ ├── Textarea.vue │ │ │ │ ├── Switch.vue │ │ │ │ ├── Image.vue │ │ │ │ ├── Radio.vue │ │ │ │ ├── Checkbox.vue │ │ │ │ └── Text.vue │ │ ├── main.ts │ │ ├── store.ts │ │ └── utils.ts │ ├── postcss.config.js │ ├── tsconfig.node.json │ ├── vite.config.ts │ ├── tsconfig.json │ ├── tailwind.config.js │ └── package.json ├── test │ ├── iOS │ │ ├── Test │ │ │ └── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ └── AccentColor.colorset │ │ │ │ └── Contents.json │ │ ├── Podfile │ │ ├── Test.xcodeproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Test.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── tsconfig.node.json │ ├── src │ │ ├── App.vue │ │ ├── main.ts │ │ ├── env.d.ts │ │ ├── components │ │ │ └── StateIcon.vue │ │ ├── app.json │ │ ├── pages │ │ │ ├── WebSocket.vue │ │ │ ├── Base.vue │ │ │ └── System.vue │ │ ├── utils.ts │ │ └── global.d.ts │ ├── README.md │ ├── vite.config.ts │ ├── package.json │ └── tsconfig.json ├── shared │ ├── vite.config.ts │ ├── src │ │ ├── syncFlags.ts │ │ ├── devtools.ts │ │ ├── index.ts │ │ └── event.ts │ └── package.json ├── create-evoker │ ├── template-blank │ │ ├── src │ │ │ ├── main.ts │ │ │ ├── App.vue │ │ │ ├── env.d.ts │ │ │ ├── app.json │ │ │ ├── components │ │ │ │ └── HelloWorld.vue │ │ │ └── assets │ │ │ │ └── github.svg │ │ ├── tsconfig.node.json │ │ ├── vite.config.ts │ │ ├── package.json │ │ └── tsconfig.json │ ├── template-iOS │ │ ├── Launcher │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── LOGO.png │ │ │ │ │ └── Contents.json │ │ │ │ └── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ ├── app-service.evpkg │ │ │ ├── Codable+Extension.swift │ │ │ └── AppDelegate.swift │ │ ├── Launcher.xcodeproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Launcher.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── Podfile │ ├── _README.md │ ├── package.json │ └── README.md ├── service │ ├── vite.config.ts │ ├── src │ │ ├── bridge │ │ │ ├── api │ │ │ │ ├── request │ │ │ │ │ ├── index.ts │ │ │ │ │ └── task.ts │ │ │ │ ├── base │ │ │ │ │ └── base64.ts │ │ │ │ └── html │ │ │ │ │ └── canvas │ │ │ │ │ └── utils.ts │ │ │ └── bridge.ts │ │ ├── dom │ │ │ ├── text.ts │ │ │ ├── comment.ts │ │ │ ├── svg.ts │ │ │ ├── html.ts │ │ │ └── element.ts │ │ ├── utils.ts │ │ ├── runtime-jscore │ │ │ └── modules │ │ │ │ ├── class.ts │ │ │ │ ├── attrs.ts │ │ │ │ └── props.ts │ │ └── index.ts │ └── package.json ├── bridge │ ├── vite.config.ts │ ├── src │ │ ├── api │ │ │ └── const.ts │ │ ├── errors.ts │ │ ├── utils.ts │ │ └── pipeline.ts │ └── package.json ├── devtools │ ├── vite.config.ts │ ├── src │ │ └── index.ts │ └── package.json ├── evoker │ ├── src │ │ └── index.ts │ ├── vite.config.ts │ └── package.json └── vue │ ├── dist │ └── vue.d.ts │ └── package.json ├── pnpm-workspace.yaml ├── .gitattributes ├── .prettierrc ├── iOS ├── Evoker │ └── Sources │ │ ├── Resources │ │ ├── Image.xcassets │ │ │ ├── Contents.json │ │ │ ├── album-icon.imageset │ │ │ │ ├── album-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── close-icon.imageset │ │ │ │ ├── close-icon@2x.png │ │ │ │ ├── close-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── back-arrow-icon.imageset │ │ │ │ ├── back-arrow-icon@2x.png │ │ │ │ ├── back-arrow-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── down-arrow-icon.imageset │ │ │ │ ├── down-arrow-icon@2x.png │ │ │ │ ├── down-arrow-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── hud-error-icon.imageset │ │ │ │ ├── hud-error-icon@2x.png │ │ │ │ ├── hud-error-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── scan-effect-img.imageset │ │ │ │ ├── scan-effect-img@2x.png │ │ │ │ ├── scan-effect-img@3x.png │ │ │ │ └── Contents.json │ │ │ ├── hud-loading-icon.imageset │ │ │ │ ├── hud-loading-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── hud-success-icon.imageset │ │ │ │ ├── hud-success-icon@2x.png │ │ │ │ ├── hud-success-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── navigation-loading.imageset │ │ │ │ ├── navigation-loading@3x.png │ │ │ │ └── Contents.json │ │ │ ├── tab-bar-item-badge.imageset │ │ │ │ ├── tab-bar-item-badge@3x.png │ │ │ │ └── Contents.json │ │ │ ├── back-arrow-icon-dark.imageset │ │ │ │ ├── back-arrow-icon-dark@2x.png │ │ │ │ ├── back-arrow-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── tab-bar-item-red-dot.imageset │ │ │ │ ├── tab-bar-item-red-dot@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mini-program-home-icon.imageset │ │ │ │ ├── mini-program-home-icon@2x.png │ │ │ │ └── Contents.json │ │ │ ├── mini-program-more-icon.imageset │ │ │ │ ├── mini-program-more-icon@2x.png │ │ │ │ └── Contents.json │ │ │ ├── mini-program-close-icon.imageset │ │ │ │ ├── mini-program-close-icon@2x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-button-bg.imageset │ │ │ │ ├── mp-action-sheet-button-bg@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-share-icon.imageset │ │ │ │ ├── mp-action-sheet-share-icon@2x.png │ │ │ │ ├── mp-action-sheet-share-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── back-arrow-icon-circle-dark.imageset │ │ │ │ ├── back-arrow-icon-circle-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mini-program-more-icon-dark.imageset │ │ │ │ ├── mini-program-more-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-reload-icon.imageset │ │ │ │ ├── mp-action-sheet-reload-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mini-program-close-icon-dark.imageset │ │ │ │ ├── mini-program-close-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-button-bg-hl.imageset │ │ │ │ ├── mp-action-sheet-button-bg-hl@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-setting-icon.imageset │ │ │ │ ├── mp-action-sheet-setting-icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-button-bg-dark.imageset │ │ │ │ ├── mp-action-sheet-button-bg-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-share-icon-dark.imageset │ │ │ │ ├── mp-action-sheet-share-icon-dark@2x.png │ │ │ │ ├── mp-action-sheet-share-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-reload-icon-dark.imageset │ │ │ │ ├── mp-action-sheet-reload-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ │ ├── mp-action-sheet-button-bg-hl-dark.imageset │ │ │ │ ├── mp-action-sheet-button-bg-hl-dark@3x.png │ │ │ │ └── Contents.json │ │ │ └── mp-action-sheet-setting-icon-dark.imageset │ │ │ │ ├── mp-action-sheet-setting-icon-dark@3x.png │ │ │ │ └── Contents.json │ │ ├── Sound │ │ │ └── scan-code.wav │ │ └── SDK │ │ │ └── evoker-sdk.evpkg │ │ ├── Extension │ │ ├── Number+Extension.swift │ │ ├── CGRect+Extension.swift │ │ ├── URL+Extension.swift │ │ ├── Array+Extension.swift │ │ ├── UIScrollView+Tongceng.swift │ │ ├── NSAttributedString+Extension.swift │ │ ├── TimeInterval+Extension.swift │ │ └── UIColor+Theme.swift │ │ ├── Common │ │ └── Interaction │ │ │ └── TransitionView.swift │ │ ├── Page │ │ ├── Web │ │ │ └── View │ │ │ │ └── NativelyContainerView.swift │ │ └── Browser │ │ │ └── BrowserPage.swift │ │ ├── Service │ │ └── AppInfo.swift │ │ └── Bridge │ │ └── API │ │ ├── CanvasAPI.swift │ │ └── Device │ │ └── BatteryAPI.swift └── EvokerMap │ └── Sources │ └── MapModule.swift ├── scripts ├── test.js └── dev.js ├── .vscode └── settings.json ├── tsconfig.json └── LICENSE /packages/launcher/README.md: -------------------------------------------------------------------------------- 1 | # Launcher 2 | 3 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/**' -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/form/Form.less: -------------------------------------------------------------------------------- 1 | ek-form { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/text/Text.less: -------------------------------------------------------------------------------- 1 | ek-text { 2 | cursor: text; 3 | } 4 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/view/View.less: -------------------------------------------------------------------------------- 1 | ek-view { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/cli/bin/evoker.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict" 3 | 4 | require("../dist/cli.cjs") 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker/Picker.less: -------------------------------------------------------------------------------- 1 | ek-picker { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/example/src/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /packages/launcher/src/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /packages/webview/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [require("autoprefixer")] 3 | } 4 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/label/index.ts: -------------------------------------------------------------------------------- 1 | import Label from "./Label" 2 | 3 | export default Label 4 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/radio-group/RadioGroup.less: -------------------------------------------------------------------------------- 1 | ek-radio-group { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | semi: false 2 | singleQuote: false 3 | printWidth: 100 4 | trailingComma: 'none' 5 | arrowParens: 'avoid' 6 | -------------------------------------------------------------------------------- /packages/example/src/assets/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/car.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/checkbox-group/CheckboxGroup.less: -------------------------------------------------------------------------------- 1 | ek-checkbox-group { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/example/src/assets/icon_API.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/icon_API.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/api.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/form.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/logo.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/map.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/nav.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/open.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/page.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/view.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/map/index.ts: -------------------------------------------------------------------------------- 1 | import Map from "./Map" 2 | import "./Map.less" 3 | 4 | export default Map 5 | -------------------------------------------------------------------------------- /packages/example/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/example/src/assets/icon_API_HL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/icon_API_HL.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/canvas.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/device.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/media.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/night.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/worker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/worker.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | import Icon from "./Icon" 2 | import "./Icon.less" 3 | 4 | export default Icon 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/form/index.ts: -------------------------------------------------------------------------------- 1 | import Form from "./Form" 2 | import "./Form.less" 3 | 4 | export default Form 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/text/index.ts: -------------------------------------------------------------------------------- 1 | import Text from "./Text" 2 | import "./Text.less" 3 | 4 | export default Text 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/view/index.ts: -------------------------------------------------------------------------------- 1 | import View from "./View" 2 | import "./View.less" 3 | 4 | export default View 5 | -------------------------------------------------------------------------------- /packages/example/src/assets/icon_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/icon_component.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/api_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/api_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/content.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/daytime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/daytime.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/feedback.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/form_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/form_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/framework.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/location.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/map_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/map_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/nav_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/nav_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/network.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/open_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/open_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/page_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/page_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/storage.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/view_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/view_dark.png -------------------------------------------------------------------------------- /packages/launcher/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/test/iOS/Test/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/Image/index.ts: -------------------------------------------------------------------------------- 1 | import Image from "./Image" 2 | import "./Image.less" 3 | 4 | export default Image 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/input/index.ts: -------------------------------------------------------------------------------- 1 | import Input from "./Input" 2 | import "./Input.less" 3 | 4 | export default Input 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/radio/index.ts: -------------------------------------------------------------------------------- 1 | import Radio from "./Radio" 2 | import "./Radio.less" 3 | 4 | export default Radio 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/index.ts: -------------------------------------------------------------------------------- 1 | import Video from "./Video" 2 | import "./Video.less" 3 | 4 | export default Video 5 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Sound/scan-code.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Sound/scan-code.wav -------------------------------------------------------------------------------- /packages/example/src/assets/kind/canvas_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/canvas_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/device_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/device_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/media_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/media_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/performance.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/worker_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/worker_dark.png -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/app-service.evpkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/launcher/iOS/Launcher/app-service.evpkg -------------------------------------------------------------------------------- /packages/webview/src/element/components/Button/index.ts: -------------------------------------------------------------------------------- 1 | import Button from "./Button" 2 | import "./Button.less" 3 | 4 | export default Button 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/camera/index.ts: -------------------------------------------------------------------------------- 1 | import Camera from "./Camera" 2 | import "./Camera.less" 3 | 4 | export default Camera 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/canvas/index.ts: -------------------------------------------------------------------------------- 1 | import Canvas from "./Canvas" 2 | import "./Canvas.less" 3 | 4 | export default Canvas 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker/index.ts: -------------------------------------------------------------------------------- 1 | import Picker from "./Picker" 2 | import "./Picker.less" 3 | 4 | export default Picker 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/slider/index.ts: -------------------------------------------------------------------------------- 1 | import Slider from "./Slider" 2 | import "./Slider.less" 3 | 4 | export default Slider 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/swiper/index.ts: -------------------------------------------------------------------------------- 1 | import Swiper from "./Swiper" 2 | import "./Swiper.less" 3 | 4 | export default Swiper 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/switch/index.ts: -------------------------------------------------------------------------------- 1 | import Switch from "./Switch" 2 | import "./Switch.less" 3 | 4 | export default Switch 5 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/SDK/evoker-sdk.evpkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/SDK/evoker-sdk.evpkg -------------------------------------------------------------------------------- /packages/example/src/assets/icon_component_HL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/icon_component_HL.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/content_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/content_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/feedback_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/feedback_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/framework_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/framework_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/location_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/location_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/network_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/network_dark.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/obstacle-free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/obstacle-free.png -------------------------------------------------------------------------------- /packages/example/src/assets/kind/storage_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/storage_dark.png -------------------------------------------------------------------------------- /packages/shared/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { createViteConfig } from "../../scripts/utils" 2 | 3 | export default createViteConfig({ target: "shared" }) 4 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/loading/index.ts: -------------------------------------------------------------------------------- 1 | import Loading from "./Loading" 2 | import "./Loading.less" 3 | 4 | export default Loading 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/navigator/Navigator.less: -------------------------------------------------------------------------------- 1 | ek-navigator { 2 | display: block; 3 | height: auto; 4 | width: auto; 5 | } 6 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'evoker' 2 | import App from './App.vue' 3 | 4 | createApp(App).mount('#app') 5 | -------------------------------------------------------------------------------- /packages/example/src/assets/kind/performance_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/performance_dark.png -------------------------------------------------------------------------------- /packages/service/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { createViteConfig } from "../../scripts/utils" 2 | 3 | export default createViteConfig({ target: "service" }) 4 | -------------------------------------------------------------------------------- /packages/webview/global.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | webViewId: number 4 | route: string 5 | } 6 | } 7 | 8 | export {} 9 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | import Checkbox from "./Checkbox" 2 | import "./Checkbox.less" 3 | 4 | export default Checkbox 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/progress/index.ts: -------------------------------------------------------------------------------- 1 | import Progress from "./Progress" 2 | import "./Progress.less" 3 | 4 | export default Progress 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/textarea/index.ts: -------------------------------------------------------------------------------- 1 | import Textarea from "./Textarea" 2 | import "./Textarea.less" 3 | 4 | export default Textarea 5 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/example/src/assets/kind/obstacle-free_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/example/src/assets/kind/obstacle-free_dark.png -------------------------------------------------------------------------------- /packages/service/src/bridge/api/request/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./request" 2 | export * from "./download" 3 | export * from "./upload" 4 | export * from "./ws" 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/input-html/index.ts: -------------------------------------------------------------------------------- 1 | import InputHTML from "./InputHTML" 2 | import "./InputHTML.less" 3 | 4 | export default InputHTML 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/map/Map.less: -------------------------------------------------------------------------------- 1 | ek-map { 2 | display: block; 3 | position: relative; 4 | width: 300px; 5 | height: 150px; 6 | } 7 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/navigator/index.ts: -------------------------------------------------------------------------------- 1 | import Navigator from "./Navigator" 2 | import "./Navigator.less" 3 | 4 | export default Navigator 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker-view/index.ts: -------------------------------------------------------------------------------- 1 | import PickerView from "./PickerView" 2 | import "./PickerView.less" 3 | 4 | export default PickerView 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/radio-group/index.ts: -------------------------------------------------------------------------------- 1 | import RadioGroup from "./RadioGroup" 2 | import "./RadioGroup.less" 3 | 4 | export default RadioGroup 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/scroll-view/index.ts: -------------------------------------------------------------------------------- 1 | import ScrollView from "./ScrollView" 2 | import "./ScrollView.less" 3 | 4 | export default ScrollView 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/swiper-item/index.ts: -------------------------------------------------------------------------------- 1 | import SwiperItem from "./SwiperItem" 2 | import "./SwiperItem.less" 3 | 4 | export default SwiperItem 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/camera/Camera.less: -------------------------------------------------------------------------------- 1 | ek-camera { 2 | display: block; 3 | position: relative; 4 | width: 100%; 5 | overflow: hidden; 6 | } 7 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-area/index.ts: -------------------------------------------------------------------------------- 1 | import MovableArea from "./MovableArea" 2 | import "./MovableArea.less" 3 | 4 | export default MovableArea 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-view/index.ts: -------------------------------------------------------------------------------- 1 | import MovableView from "./MovableView" 2 | import "./MovableView.less" 3 | 4 | export default MovableView 5 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/app-service.evpkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/create-evoker/template-iOS/Launcher/app-service.evpkg -------------------------------------------------------------------------------- /packages/test/iOS/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | use_frameworks! 4 | 5 | target 'Test' do 6 | 7 | pod 'Evoker', :path => "../../.." 8 | 9 | end 10 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/VideoButton/index.ts: -------------------------------------------------------------------------------- 1 | import VideoButton from "./VideoButton" 2 | import "./VideoButton.less" 3 | 4 | export default VideoButton 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/checkbox-group/index.ts: -------------------------------------------------------------------------------- 1 | import CheckboxGroup from "./CheckboxGroup" 2 | import "./CheckboxGroup.less" 3 | 4 | export default CheckboxGroup 5 | -------------------------------------------------------------------------------- /packages/bridge/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { createViteConfig } from "../../scripts/utils" 2 | 3 | // https://vitejs.dev/config/ 4 | export default createViteConfig({ target: "bridge" }) 5 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-area/MovableArea.less: -------------------------------------------------------------------------------- 1 | ek-movable-area { 2 | display: block; 3 | position: relative; 4 | width: 10px; 5 | height: 10px; 6 | } 7 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/VideoProgress/index.ts: -------------------------------------------------------------------------------- 1 | import VideoProgress from "./VideoProgress" 2 | import "./VideoProgress.less" 3 | 4 | export default VideoProgress 5 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/Assets.xcassets/AppIcon.appiconset/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/launcher/iOS/Launcher/Assets.xcassets/AppIcon.appiconset/LOGO.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker-view-column/index.ts: -------------------------------------------------------------------------------- 1 | import PickerViewColumn from "./PickerViewColumn" 2 | import "./PickerViewColumn.less" 3 | 4 | export default PickerViewColumn 5 | -------------------------------------------------------------------------------- /packages/test/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/album-icon.imageset/album-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/album-icon.imageset/album-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/close-icon.imageset/close-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/close-icon.imageset/close-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/close-icon.imageset/close-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/close-icon.imageset/close-icon@3x.png -------------------------------------------------------------------------------- /packages/example/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/launcher/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/test/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-view/MovableView.less: -------------------------------------------------------------------------------- 1 | ek-movable-view { 2 | display: inline-block; 3 | position: absolute; 4 | width: 10px; 5 | height: 10px; 6 | top: 0; 7 | left: 0; 8 | } 9 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/Assets.xcassets/AppIcon.appiconset/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/packages/create-evoker/template-iOS/Launcher/Assets.xcassets/AppIcon.appiconset/LOGO.png -------------------------------------------------------------------------------- /packages/devtools/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { createViteConfig } from "../../scripts/utils" 2 | 3 | export default createViteConfig({ 4 | target: "devtools", 5 | vite: { build: { rollupOptions: { external: [] } } } 6 | }) 7 | -------------------------------------------------------------------------------- /packages/example/src/components/NCellGroup.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/VideoScreenBrightness/index.ts: -------------------------------------------------------------------------------- 1 | import VideoScreenBrightness from "./VideoScreenBrightness" 2 | import "./VideoScreenBrightness.less" 3 | 4 | export default VideoScreenBrightness 5 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon.imageset/back-arrow-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon.imageset/back-arrow-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon.imageset/back-arrow-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon.imageset/back-arrow-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/down-arrow-icon.imageset/down-arrow-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/down-arrow-icon.imageset/down-arrow-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/down-arrow-icon.imageset/down-arrow-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/down-arrow-icon.imageset/down-arrow-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-error-icon.imageset/hud-error-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/hud-error-icon.imageset/hud-error-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-error-icon.imageset/hud-error-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/hud-error-icon.imageset/hud-error-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/scan-effect-img.imageset/scan-effect-img@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/scan-effect-img.imageset/scan-effect-img@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/scan-effect-img.imageset/scan-effect-img@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/scan-effect-img.imageset/scan-effect-img@3x.png -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-loading-icon.imageset/hud-loading-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/hud-loading-icon.imageset/hud-loading-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-success-icon.imageset/hud-success-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/hud-success-icon.imageset/hud-success-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-success-icon.imageset/hud-success-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/hud-success-icon.imageset/hud-success-icon@3x.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/swiper-item/SwiperItem.less: -------------------------------------------------------------------------------- 1 | ek-swiper-item { 2 | display: block; 3 | overflow: hidden; 4 | width: 100%; 5 | height: 100%; 6 | will-change: transform; 7 | position: absolute; 8 | } 9 | -------------------------------------------------------------------------------- /packages/test/iOS/Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/navigation-loading.imageset/navigation-loading@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/navigation-loading.imageset/navigation-loading@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-badge.imageset/tab-bar-item-badge@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-badge.imageset/tab-bar-item-badge@3x.png -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-dark.imageset/back-arrow-icon-dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-dark.imageset/back-arrow-icon-dark@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-dark.imageset/back-arrow-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-dark.imageset/back-arrow-icon-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-red-dot.imageset/tab-bar-item-red-dot@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-red-dot.imageset/tab-bar-item-red-dot@3x.png -------------------------------------------------------------------------------- /packages/test/iOS/Test/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-home-icon.imageset/mini-program-home-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-home-icon.imageset/mini-program-home-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon.imageset/mini-program-more-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon.imageset/mini-program-more-icon@2x.png -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon.imageset/mini-program-close-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon.imageset/mini-program-close-icon@2x.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/Swiper/constant.ts: -------------------------------------------------------------------------------- 1 | import { ComputedRef, InjectionKey } from "vue" 2 | 3 | export type SwipeProvide = { 4 | count: ComputedRef 5 | } 6 | 7 | export const SWIPE_KEY: InjectionKey = Symbol("swiper") 8 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg.imageset/mp-action-sheet-button-bg@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg.imageset/mp-action-sheet-button-bg@3x.png -------------------------------------------------------------------------------- /packages/example/src/components/NTopic.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/test/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "evoker" 2 | import App from "./App.vue" 3 | import TaskBoard from "./components/TaskBoard.vue" 4 | 5 | const app = createApp(App) 6 | 7 | app.component("TaskBoard", TaskBoard) 8 | 9 | app.mount("#app") 10 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon.imageset/mp-action-sheet-share-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon.imageset/mp-action-sheet-share-icon@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon.imageset/mp-action-sheet-share-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon.imageset/mp-action-sheet-share-icon@3x.png -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-circle-dark.imageset/back-arrow-icon-circle-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-circle-dark.imageset/back-arrow-icon-circle-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon-dark.imageset/mini-program-more-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon-dark.imageset/mini-program-more-icon-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon.imageset/mp-action-sheet-reload-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon.imageset/mp-action-sheet-reload-icon@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon-dark.imageset/mini-program-close-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon-dark.imageset/mini-program-close-icon-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl.imageset/mp-action-sheet-button-bg-hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl.imageset/mp-action-sheet-button-bg-hl@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon.imageset/mp-action-sheet-setting-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon.imageset/mp-action-sheet-setting-icon@3x.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker-view/PickerView.less: -------------------------------------------------------------------------------- 1 | ek-picker-view { 2 | display: block; 3 | } 4 | 5 | .ek-picker-view { 6 | &__wrapper { 7 | display: flex; 8 | position: relative; 9 | overflow: hidden; 10 | height: 100%; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-dark.imageset/mp-action-sheet-button-bg-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-dark.imageset/mp-action-sheet-button-bg-dark@3x.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/Radio/constant.ts: -------------------------------------------------------------------------------- 1 | import { InjectionKey } from "vue" 2 | 3 | export interface RadioProvide { 4 | onChecked: (value: string, dispatch: boolean) => void 5 | } 6 | 7 | export const RADIO_GROUP_KEY: InjectionKey = Symbol("radioGroup") 8 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon-dark.imageset/mp-action-sheet-share-icon-dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon-dark.imageset/mp-action-sheet-share-icon-dark@2x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon-dark.imageset/mp-action-sheet-share-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon-dark.imageset/mp-action-sheet-share-icon-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon-dark.imageset/mp-action-sheet-reload-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon-dark.imageset/mp-action-sheet-reload-icon-dark@3x.png -------------------------------------------------------------------------------- /packages/webview/src/element/components/Image/Image.less: -------------------------------------------------------------------------------- 1 | ek-image { 2 | display: inline-block; 3 | width: 320px; 4 | height: 240px; 5 | max-height: 100%; 6 | max-width: 100%; 7 | overflow: hidden; 8 | 9 | > div { 10 | height: 100%; 11 | width: 100%; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl-dark.imageset/mp-action-sheet-button-bg-hl-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl-dark.imageset/mp-action-sheet-button-bg-hl-dark@3x.png -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon-dark.imageset/mp-action-sheet-setting-icon-dark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhi996/evoker/HEAD/iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon-dark.imageset/mp-action-sheet-setting-icon-dark@3x.png -------------------------------------------------------------------------------- /packages/evoker/src/index.ts: -------------------------------------------------------------------------------- 1 | import { global } from "@evoker/service" 2 | import { getApp, getCurrentPages } from "@evoker/service" 3 | 4 | export * from "@evoker/service" 5 | 6 | globalThis.ek = global 7 | 8 | globalThis.getApp = getApp 9 | 10 | globalThis.getCurrentPages = getCurrentPages 11 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/canvas/Canvas.less: -------------------------------------------------------------------------------- 1 | ek-canvas { 2 | display: block; 3 | position: relative; 4 | width: 300px; 5 | height: 150px; 6 | } 7 | 8 | .ek-canvas__inner { 9 | position: absolute; 10 | width: 100%; 11 | height: 100%; 12 | left: 0; 13 | top: 0; 14 | } 15 | -------------------------------------------------------------------------------- /packages/launcher/src/components/TableViewSeciton.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /packages/service/src/dom/text.ts: -------------------------------------------------------------------------------- 1 | import { EvokerPage } from "./page" 2 | import { EvokerElement } from "./element" 3 | 4 | export class EvokerText extends EvokerElement { 5 | constructor(textContent: string, page: EvokerPage) { 6 | super("", page) 7 | this.textContent = textContent 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/devtools/src/index.ts: -------------------------------------------------------------------------------- 1 | import { invokeHandler, publishHandler } from "./webSocket" 2 | import TouchEmulator from "hammer-touchemulator" 3 | 4 | export { invokeHandler, publishHandler } 5 | 6 | if (globalThis.__Config.env === "webview") { 7 | TouchEmulator() 8 | TouchEmulator.ignoreTags = [] 9 | } 10 | -------------------------------------------------------------------------------- /packages/service/src/dom/comment.ts: -------------------------------------------------------------------------------- 1 | import { EvokerPage } from "./page" 2 | import { EvokerNode } from "./node" 3 | 4 | export class EvokerComment extends EvokerNode { 5 | data: string 6 | 7 | constructor(data: string, page: EvokerPage) { 8 | super(page) 9 | 10 | this.data = data 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/Checkbox/constant.ts: -------------------------------------------------------------------------------- 1 | import { InjectionKey } from "vue" 2 | 3 | export interface CheckboxProvide { 4 | onChecked: (value: string, checked: boolean, dispatch: boolean) => void 5 | } 6 | 7 | export const CHECKBOX_GROUP_KEY: InjectionKey = Symbol("checkboxGroup") 8 | -------------------------------------------------------------------------------- /packages/test/iOS/Test.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/vue/dist/vue.d.ts: -------------------------------------------------------------------------------- 1 | import { CompilerOptions } from '@vue/compiler-dom'; 2 | import { RenderFunction } from '@vue/runtime-dom'; 3 | 4 | export declare function compile(template: string | HTMLElement, options?: CompilerOptions): RenderFunction; 5 | 6 | 7 | export * from "@vue/runtime-dom"; 8 | 9 | export { } 10 | -------------------------------------------------------------------------------- /packages/example/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "*.vue" { 4 | import { DefineComponent } from "vue" 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/launcher/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite" 2 | 3 | // https://vitejs.dev/config/ 4 | export default defineConfig(({ mode }) => { 5 | return { 6 | define: { 7 | "process.env.NODE_ENV": JSON.stringify(mode) 8 | }, 9 | server: { 10 | host: true 11 | } 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /packages/webview/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "*.vue" { 4 | import { DefineComponent } from "vue" 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/launcher/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/launcher/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "evoker" 2 | import { createPinia } from "pinia" 3 | 4 | import App from "./App.vue" 5 | 6 | import "./tailwind.css" 7 | 8 | ek.hideCapsule() 9 | 10 | const app = createApp(App) 11 | 12 | const pinia = createPinia() 13 | app.use(pinia) 14 | 15 | app.mount("#app") 16 | -------------------------------------------------------------------------------- /packages/test/iOS/Test.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/test/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/picker-view/define.ts: -------------------------------------------------------------------------------- 1 | import { InjectionKey } from "vue" 2 | 3 | export interface PickerViewProvide { 4 | onChange: () => void 5 | onPickStart: () => void 6 | onPickEnd: () => void 7 | } 8 | 9 | export const PICKER_VIEW_KEY: InjectionKey = Symbol("picker-view") 10 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/textarea/Textarea.less: -------------------------------------------------------------------------------- 1 | ek-textarea { 2 | display: block; 3 | position: relative; 4 | width: 300px; 5 | height: 150px; 6 | cursor: auto; 7 | overflow: hidden; 8 | } 9 | 10 | .ek-textarea { 11 | &__placeholder { 12 | color: gray; 13 | display: none; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/radio/Radio.less: -------------------------------------------------------------------------------- 1 | ek-radio { 2 | display: flex; 3 | align-items: center; 4 | overflow: hidden; 5 | } 6 | 7 | .ek-radio { 8 | &__label { 9 | margin-left: 5px; 10 | color: #323233; 11 | line-height: 20px; 12 | } 13 | 14 | &--disabled { 15 | opacity: 0.5; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite" 2 | 3 | // https://vitejs.dev/config/ 4 | export default defineConfig(({ mode }) => { 5 | return { 6 | define: { 7 | "process.env.NODE_ENV": JSON.stringify(mode) 8 | }, 9 | server: { 10 | host: true 11 | } 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LOGO.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/launcher/src/components/TableViewCell.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/test/iOS/Test.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/checkbox/Checkbox.less: -------------------------------------------------------------------------------- 1 | ek-checkbox { 2 | display: flex; 3 | align-items: center; 4 | overflow: hidden; 5 | } 6 | 7 | .ek-checkbox { 8 | &__label { 9 | margin-left: 5px; 10 | color: #323233; 11 | line-height: 20px; 12 | } 13 | 14 | &--disabled { 15 | opacity: 0.5; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/input/Input.less: -------------------------------------------------------------------------------- 1 | ek-input { 2 | cursor: auto; 3 | display: block; 4 | width: 100%; 5 | height: 1.4rem; 6 | overflow: hidden; 7 | text-overflow: clip; 8 | white-space: nowrap; 9 | position: relative; 10 | } 11 | 12 | .ek-input { 13 | &__placeholder { 14 | color: gray; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/shared/src/syncFlags.ts: -------------------------------------------------------------------------------- 1 | export const enum SyncFlags { 2 | CREATE = 0, 3 | INSERT, 4 | SET_TEXT, 5 | REMOVE, 6 | DISPLAY, 7 | ADD_EVENT, 8 | UPDATE_PROP, 9 | SET_MODEL_VALUE, 10 | DISPATCH_EVENT, 11 | SELECTOR, 12 | ADD_INTERSECTION_OBSERVER, 13 | REMOVE_INTERSECTION_OBSERVER, 14 | INTERSECTION_OBSERVER_ENTRY 15 | } 16 | -------------------------------------------------------------------------------- /packages/vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@evoker/vue", 3 | "version": "0.13.0", 4 | "main": "dist/vue.runtime.global.js", 5 | "types": "dist/vue.d.ts", 6 | "description": "fork vue", 7 | "dependencies": { 8 | "@vue/compiler-dom": "^3.2.39", 9 | "@vue/runtime-dom": "^3.2.39" 10 | }, 11 | "files": [ 12 | "dist" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/bridge.ts: -------------------------------------------------------------------------------- 1 | import { invoke, invokeCallbackHandler, publish, subscribe, subscribeHandler } from "@evoker/bridge" 2 | 3 | const JSBridge = { 4 | invoke, 5 | publish, 6 | subscribe, 7 | invokeCallbackHandler, 8 | subscribeHandler 9 | } 10 | ;(globalThis as any).JSBridge = JSBridge 11 | 12 | export default JSBridge 13 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-area/constant.ts: -------------------------------------------------------------------------------- 1 | import { ComputedRef, InjectionKey } from "vue" 2 | 3 | export interface MovableProvide { 4 | count: ComputedRef 5 | areaSize: { 6 | width: number 7 | height: number 8 | } 9 | } 10 | 11 | export const MOVABLE_KEY: InjectionKey = Symbol("movable") 12 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LOGO.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/bridge/src/api/const.ts: -------------------------------------------------------------------------------- 1 | export const EKFILE_SCHEME = "ekfile://" 2 | 3 | export const EKFILE_TMP = EKFILE_SCHEME + "tmp_" 4 | 5 | export const EKFILE_STORE = EKFILE_SCHEME + "store_" 6 | 7 | export const USER_DATA_PATH = EKFILE_SCHEME + "usr" 8 | 9 | /** 环境变量 */ 10 | export const env = { 11 | /** 文件系统中的用户目录路径 (本地路径) */ 12 | USER_DATA_PATH 13 | } 14 | -------------------------------------------------------------------------------- /packages/example/src/components/NCell.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Vibrate.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 15 | -------------------------------------------------------------------------------- /packages/launcher/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /packages/test/README.md: -------------------------------------------------------------------------------- 1 | # Evoker 2 | 3 | ### 启动应用 4 | 5 | 1. 启动 Node 项目 6 | ``` 7 | // 安装依赖 8 | npm / yarn /pnpm install 9 | 10 | // 启动 dev server 11 | npm / yarn /pnpm run dev 12 | ``` 13 | 14 | 2. 启动 iOS 15 | ``` 16 | cd iOS 17 | 18 | // 安装 iOS 依赖 19 | pod install 20 | ``` 21 | 22 | 3. 打开 `iOS/${projectName}.xcworkspace` 运行在指定设备或者模拟器 23 | 24 | * 如果要在真机运行,请设置 Bundle Identifier 和 签名证书 -------------------------------------------------------------------------------- /packages/evoker/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { createViteConfig } from "../../scripts/utils" 2 | 3 | export default createViteConfig({ 4 | target: "evoker", 5 | vite: { 6 | build: { 7 | rollupOptions: { 8 | external: ["vue"], 9 | output: { 10 | globals: { 11 | vue: "Vue" 12 | } 13 | } 14 | } 15 | } 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /packages/example/src/pages/Component/Navigator.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/create-evoker/_README.md: -------------------------------------------------------------------------------- 1 | # Evoker 2 | 3 | ### 启动应用 4 | 5 | 1. 启动 Node 项目 6 | ``` 7 | // 安装依赖 8 | npm / yarn /pnpm install 9 | 10 | // 启动 dev server 11 | npm / yarn /pnpm run dev 12 | ``` 13 | 14 | 2. 启动 iOS 15 | ``` 16 | cd iOS 17 | 18 | // 安装 iOS 依赖 19 | pod install 20 | ``` 21 | 22 | 3. 打开 `iOS/${projectName}.xcworkspace` 运行在指定设备或者模拟器 23 | 24 | * 如果要在真机运行,请设置 Bundle Identifier 和 签名证书 -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/Number+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Number+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | extension UInt64 { 12 | 13 | var mb: Double { 14 | return Double(self) / 1024.0 / 1024.0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/launcher/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./src/**/*.{vue,js,ts,jsx,tsx}"], 3 | darkMode: "media", 4 | theme: { 5 | extend: {} 6 | }, 7 | variants: { 8 | extend: { 9 | backgroundColor: ["active"], 10 | margin: ["first", "last"], 11 | padding: ["first", "last"], 12 | border: ["last"] 13 | } 14 | }, 15 | plugins: [] 16 | } 17 | -------------------------------------------------------------------------------- /packages/service/src/dom/svg.ts: -------------------------------------------------------------------------------- 1 | import { EvokerElement } from "./element" 2 | import { EvokerPage } from "./page" 3 | 4 | export class EvokerSVGElement extends EvokerElement { 5 | isSVG = true 6 | 7 | namespaceURI: string 8 | 9 | constructor(namespaceURI: string, tagName: string, page: EvokerPage) { 10 | super(tagName, page) 11 | 12 | this.namespaceURI = namespaceURI 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/text/Text.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent } from "vue" 2 | 3 | const props = { 4 | userSelect: { type: Boolean, default: false } 5 | } 6 | 7 | export default defineComponent({ 8 | name: "ek-text", 9 | props, 10 | setup() { 11 | return () => ( 12 | 13 | 14 | 15 | ) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Common/Interaction/TransitionView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransitionView.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | protocol TransitionView: UIView { 13 | 14 | func show(to view: UIView) 15 | 16 | func hide() 17 | } 18 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/Codable+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Codable+Extension.swift 3 | // Launcher 4 | // 5 | 6 | import Foundation 7 | 8 | extension Encodable { 9 | 10 | var dictionary: [String: Any]? { 11 | guard let data = try? JSONEncoder().encode(self) else { return nil } 12 | return (try? JSONSerialization.jsonObject(with: data, options: .allowFragments)).flatMap { $0 as? [String: Any] } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/service/src/bridge/api/request/task.ts: -------------------------------------------------------------------------------- 1 | import { InnerJSBridge } from "../../bridge" 2 | 3 | export class Task { 4 | readonly taskId: string 5 | 6 | isCancel = false 7 | 8 | constructor(kind: string) { 9 | this.taskId = `${kind}_${Date.now()}` 10 | } 11 | 12 | /** 中断请求任务 */ 13 | abort() { 14 | this.isCancel = true 15 | InnerJSBridge.invoke("cancelRequest", { taskId: this.taskId }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/launcher/src/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.evokerdev.launcher", 3 | "version": "1.0.0", 4 | "window": { 5 | "navigationBarBackgroundColor": "#ffffff", 6 | "navigationBarTextStyle": "black", 7 | "navigationBarTitleText": "", 8 | "navigationStyle": "default", 9 | "backgroundColor": "#f2f2f7" 10 | }, 11 | "pages": [{ "path": "pages/Index", "style": { "navigationStyle": "custom" } }, "pages/Config"] 12 | } 13 | -------------------------------------------------------------------------------- /packages/service/src/utils.ts: -------------------------------------------------------------------------------- 1 | export function randomId() { 2 | return ramdomString(6) 3 | } 4 | 5 | export function ramdomString(length: number) { 6 | let result = "" 7 | let characters = "abcdefghijklmnopqrstuvwxyz0123456789" 8 | const charactersLength = characters.length 9 | for (let i = 0; i < length; i++) { 10 | result += characters.charAt(Math.floor(Math.random() * charactersLength)) 11 | } 12 | return result 13 | } 14 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/api/image.ts: -------------------------------------------------------------------------------- 1 | import JSBridge from "../bridge" 2 | 3 | export function getLocalImage(src: string): Promise { 4 | return new Promise((reslove, reject) => { 5 | JSBridge.invoke<{ src: string }>("getLocalImage", { path: src }, result => { 6 | if (result.errMsg) { 7 | reject(result.errMsg) 8 | } else { 9 | reslove(result.data!.src) 10 | } 11 | }) 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/scroll-view/ScrollView.less: -------------------------------------------------------------------------------- 1 | ek-scroll-view { 2 | display: block; 3 | width: 100%; 4 | } 5 | 6 | .ek-scroll-view__wrapper { 7 | position: relative; 8 | width: 100%; 9 | height: 100%; 10 | max-height: inherit; 11 | -webkit-overflow-scrolling: touch; 12 | 13 | &--vertical { 14 | overflow-x: hidden; 15 | } 16 | 17 | &--horizontal { 18 | overflow-y: hidden; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /scripts/test.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import minimist from "minimist" 3 | import { execa } from "execa" 4 | import { packageDirectory } from "./utils.js" 5 | 6 | const args = minimist(process.argv.slice(2)) 7 | 8 | const target = args._[0] 9 | 10 | async function test(pkg) { 11 | await execa("vitest", ["--config", "vite.config.ts"], { 12 | stdio: "inherit", 13 | cwd: packageDirectory(pkg) 14 | }) 15 | } 16 | 17 | test(target) 18 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Launcher/Codable+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Codable+Extension.swift 3 | // Launcher 4 | // 5 | 6 | import Foundation 7 | 8 | extension Encodable { 9 | 10 | var dictionary: [String: Any]? { 11 | guard let data = try? JSONEncoder().encode(self) else { return nil } 12 | return (try? JSONSerialization.jsonObject(with: data, options: .allowFragments)).flatMap { $0 as? [String: Any] } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/src/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.evokerdev.blank", 3 | "version": "1.0.0", 4 | "window": { 5 | "navigationBarBackgroundColor": "#ffffff", 6 | "navigationBarTextStyle": "black", 7 | "navigationBarTitleText": "Evoker", 8 | "navigationStyle": "default", 9 | "backgroundColor": "#ffffff" 10 | }, 11 | "pages": [ 12 | { 13 | "path": "components/HelloWorld" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/webview/src/element/composables/useResize.ts: -------------------------------------------------------------------------------- 1 | export function useResize(el: HTMLElement) { 2 | let callback: (rect: DOMRect) => void | undefined 3 | 4 | const onResize = () => { 5 | callback && callback(el.getBoundingClientRect()) 6 | } 7 | 8 | el.addEventListener("resize", onResize) 9 | 10 | return { 11 | onResize: (hook: (rect: DOMRect) => void) => { 12 | callback = hook 13 | onResize() 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/progress/Progress.less: -------------------------------------------------------------------------------- 1 | ek-progress { 2 | display: flex; 3 | align-items: center; 4 | width: 100%; 5 | } 6 | 7 | .ek-progress { 8 | &__track { 9 | flex: 1; 10 | } 11 | 12 | &__active { 13 | width: 0; 14 | height: 100%; 15 | } 16 | 17 | &__value { 18 | font-size: 16px; 19 | margin-bottom: 0; 20 | margin-left: 15px; 21 | margin-top: 0; 22 | min-width: 2em; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/example/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite" 2 | import { resolve } from "path" 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig(({ mode }) => { 6 | return { 7 | define: { 8 | "process.env.NODE_ENV": JSON.stringify(mode) 9 | }, 10 | resolve: { 11 | alias: { 12 | "@": resolve(__dirname, "./src") 13 | } 14 | }, 15 | server: { 16 | host: true 17 | } 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /packages/cli/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from "path" 2 | import { createViteConfig } from "../../scripts/utils" 3 | import builtinModules from "builtin-modules" 4 | 5 | const pkg = require(resolve(__dirname, `package.json`)) 6 | 7 | export default createViteConfig({ 8 | target: "cli", 9 | vite: { 10 | build: { 11 | rollupOptions: { 12 | external: [...Object.keys(pkg.dependencies), ...builtinModules] 13 | } 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /packages/webview/src/element/directive/tap.ts: -------------------------------------------------------------------------------- 1 | import { Directive } from "vue" 2 | import { isFunction } from "@vue/shared" 3 | import { addClickEvent } from "../../dom/event" 4 | 5 | export const vTap: Directive = { 6 | mounted(el, binding) { 7 | const modifiers = Object.keys(binding.modifiers) 8 | el.__listenerOptions = { click: { modifiers } } 9 | addClickEvent(el, ev => { 10 | isFunction(binding.value) && binding.value(ev) 11 | }) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/album-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "album-icon@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/ScanCode.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/CGRect+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGRect+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension CGRect { 13 | 14 | func toDict() -> [String: CGFloat] { 15 | return ["x": origin.x, "y": origin.y, "width": size.width, "height": size.height] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-loading-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "hud-loading-icon@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/navigation-loading.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "navigation-loading@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/launcher/src/utils.ts: -------------------------------------------------------------------------------- 1 | import parse from "url-parse" 2 | import { EnvVersion } from "./storage" 3 | 4 | export function parseURL(urlstr: string) { 5 | return parse(urlstr, true) 6 | } 7 | 8 | export function isWebSocketURL(urlstr: string) { 9 | return parseURL(urlstr).protocol === "ws:" 10 | } 11 | 12 | export function isEqualApp(lhs: T, rhs: T) { 13 | return lhs.appId === rhs.appId && lhs.envVersion === rhs.envVersion 14 | } 15 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/api/context.ts: -------------------------------------------------------------------------------- 1 | import { isEvokerElement, nodes } from "../../dom/element" 2 | 3 | interface OperateContextOptions { 4 | nodeId: number 5 | method: string 6 | data: Record 7 | } 8 | 9 | export function operateContext(options: OperateContextOptions) { 10 | const node = nodes.get(options.nodeId) 11 | if (node && isEvokerElement(node.el)) { 12 | node.el.__instance!.exposed!.operate(options) 13 | } 14 | return Promise.resolve({}) 15 | } 16 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-home-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mini-program-home-icon@2x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mini-program-more-icon@2x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-red-dot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "tab-bar-item-red-dot@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mini-program-close-icon@2x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/NavigationBarLoading.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 17 | -------------------------------------------------------------------------------- /packages/test/src/components/StateIcon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-circle-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "back-arrow-icon-circle-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-more-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mini-program-more-icon-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-button-bg@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-reload-icon@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mini-program-close-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mini-program-close-icon-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-button-bg-hl@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-setting-icon@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/PageScroll.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /packages/test/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite" 2 | import { resolve } from "path" 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig(({ mode }) => { 6 | return { 7 | define: { 8 | "process.env.NODE_ENV": JSON.stringify(mode) 9 | }, 10 | server: { 11 | host: true 12 | }, 13 | evoker: { 14 | dev: { 15 | devSDK: { 16 | root: resolve(__dirname, "../..") 17 | }, 18 | 19 | } 20 | } 21 | } 22 | }) 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/URL+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | extension URL { 12 | 13 | var fileSize: Int { 14 | guard isFileURL else { return 0 } 15 | let resourceValues = try? resourceValues(forKeys: [.fileSizeKey]) 16 | return resourceValues?.fileSize ?? 0 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-button-bg-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-reload-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-reload-icon-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/service/src/dom/html.ts: -------------------------------------------------------------------------------- 1 | import { EvokerCSSStyleDeclaration } from "./style" 2 | import { EvokerElement } from "./element" 3 | import { EvokerPage } from "./page" 4 | 5 | export type Style = string | Record | null 6 | 7 | export class EvokerHTMLElement extends EvokerElement { 8 | style: EvokerCSSStyleDeclaration 9 | 10 | constructor(tagName: string, page: EvokerPage) { 11 | super(tagName, page) 12 | 13 | this.style = new EvokerCSSStyleDeclaration(this) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/close-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "close-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "close-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-button-bg-hl-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-button-bg-hl-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-setting-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "mp-action-sheet-setting-icon-dark@3x.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/GetNetworkType.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | -------------------------------------------------------------------------------- /packages/service/src/bridge/api/base/base64.ts: -------------------------------------------------------------------------------- 1 | /** 将 Base64 字符串转成 ArrayBuffer 对象 */ 2 | export function base64ToArrayBuffer( 3 | /** 要转化成 ArrayBuffer 对象的 Base64 字符串 */ 4 | string: string 5 | ): ArrayBuffer { 6 | return globalThis.__Base64.base64ToArrayBuffer(string) 7 | } 8 | 9 | /** 将 ArrayBuffer 对象转成 Base64 字符串 */ 10 | export function arrayBufferToBase64( 11 | /** 要转换成 Base64 字符串的 ArrayBuffer 对象 */ 12 | buffer: ArrayBuffer 13 | ): string { 14 | return globalThis.__Base64.arrayBufferToBase64(buffer) 15 | } 16 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/Array+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Array+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Array { 12 | 13 | func first(ofType: T.Type) -> T? { 14 | return first { $0 as? T != nil } as? T 15 | } 16 | 17 | func filter(ofType: T.Type) -> [T] { 18 | return compactMap { $0 as? T } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-error-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "hud-error-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "hud-error-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "back-arrow-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "back-arrow-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/down-arrow-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "down-arrow-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "down-arrow-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/hud-success-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "hud-success-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "hud-success-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/scan-effect-img.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "scan-effect-img@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "scan-effect-img@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/example/src/components/VModelTest.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Login.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/SetTitle.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/back-arrow-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "back-arrow-icon-dark@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "back-arrow-icon-dark@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "mp-action-sheet-share-icon@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "mp-action-sheet-share-icon@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/test/src/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.evokerdev.test", 3 | "version": "1.0.0", 4 | "window": { 5 | "navigationBarBackgroundColor": "#ffffff", 6 | "navigationBarTextStyle": "black", 7 | "navigationBarTitleText": "Evoker", 8 | "navigationStyle": "default", 9 | "backgroundColor": "#f3f4f6" 10 | }, 11 | "pages": [ 12 | "pages/Index", 13 | "pages/Base", 14 | "pages/System", 15 | "pages/Interaction", 16 | "pages/Navigation", 17 | "pages/Storage", 18 | "pages/Network", 19 | "pages/WebSocket" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/PullDownRefresh.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 21 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/mp-action-sheet-share-icon-dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "mp-action-sheet-share-icon-dark@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "mp-action-sheet-share-icon-dark@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "private": true, 4 | "version": "0.0.0", 5 | "scripts": { 6 | "dev": "evoker dev", 7 | "build": "evoker build" 8 | }, 9 | "dependencies": { 10 | "evoker": "^0.13.0", 11 | "vue": "^3.2.39" 12 | }, 13 | "devDependencies": { 14 | "@evoker/cli": "^0.13.0", 15 | "@vitejs/plugin-vue": "^3.1.0", 16 | "typescript": "^4.7.4", 17 | "vite": "^3.1.3", 18 | "vue-tsc": "^0.34.17" 19 | }, 20 | "browserslist": [ 21 | "iOS >= 11", 22 | "Android >= 7.0" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": ["esnext", "dom"], 14 | "skipLibCheck": true 15 | }, 16 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 17 | "references": [{ "path": "./tsconfig.node.json" }] 18 | } 19 | -------------------------------------------------------------------------------- /packages/example/src/pages/Component/Slider.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/CaptureScreen.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 25 | -------------------------------------------------------------------------------- /packages/cli/src/index.ts: -------------------------------------------------------------------------------- 1 | import minimist from "minimist" 2 | import { build } from "./build" 3 | 4 | const args = minimist(process.argv.slice(2)) 5 | 6 | const command = args._[0] 7 | 8 | const enum Commands { 9 | DEV = "dev", 10 | BUILD = "build", 11 | PACK = "pack" 12 | } 13 | 14 | async function main() { 15 | switch (command) { 16 | case Commands.DEV: 17 | await build() 18 | break 19 | case Commands.BUILD: 20 | await build("production") 21 | break 22 | default: 23 | console.error("command is invalid.") 24 | break 25 | } 26 | } 27 | 28 | main() 29 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": ["esnext", "dom"], 14 | "skipLibCheck": true 15 | }, 16 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 17 | "references": [{ "path": "./tsconfig.node.json" }] 18 | } 19 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Page/Web/View/NativelyContainerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NativelyContainerView.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | public final class NativelyContainerView: UIView { 13 | 14 | public override func conforms(to aProtocol: Protocol) -> Bool { 15 | if NSStringFromProtocol(aProtocol) == "WKNativelyInteractible" { 16 | return true 17 | } 18 | return super.conforms(to: aProtocol) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/example/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./src/**/*.{vue,js,ts,jsx,tsx}"], 3 | darkMode: "media", 4 | theme: { 5 | extend: { 6 | minWidth: { 7 | "1/3": "33.333333%" 8 | }, 9 | minHeight: { 10 | 6: "1.5rem", 11 | 10: "2.5rem" 12 | }, 13 | maxWidth: { 14 | "1/3": "33.333333%" 15 | } 16 | } 17 | }, 18 | variants: { 19 | extend: { 20 | backgroundColor: ["active"], 21 | margin: ["first", "last"], 22 | padding: ["first", "last"], 23 | border: ["last"] 24 | } 25 | }, 26 | plugins: [] 27 | } 28 | -------------------------------------------------------------------------------- /packages/service/src/bridge/bridge.ts: -------------------------------------------------------------------------------- 1 | import { invoke, invokeCallbackHandler, publish, subscribe, subscribeHandler } from "@evoker/bridge" 2 | 3 | export const InnerJSBridge = { 4 | invoke, 5 | publish, 6 | subscribe, 7 | invokeCallbackHandler, 8 | subscribeHandler 9 | } 10 | 11 | const JSBridge = { 12 | get invoke() { 13 | return invoke 14 | }, 15 | get subscribe() { 16 | return subscribe 17 | }, 18 | get invokeCallbackHandler() { 19 | return invokeCallbackHandler 20 | }, 21 | get subscribeHandler() { 22 | return subscribeHandler 23 | } 24 | } 25 | 26 | globalThis.JSBridge = JSBridge 27 | -------------------------------------------------------------------------------- /packages/shared/src/devtools.ts: -------------------------------------------------------------------------------- 1 | export const enum DevtoolsBridgeCommands { 2 | APP_SERVICE_INVOKE = "APP_SERVICE_INVOKE", 3 | APP_SERVICE_PUBLISH = "APP_SERVICE_PUBLISH", 4 | WEB_VIEW_INVOKE = "WEB_VIEW_INVOKE", 5 | WEB_VIEW_PUBLISH = "WEB_VIEW_PUBLISH" 6 | } 7 | 8 | export const enum DevtoolsBridgeExecEvents { 9 | INVOKE_CALLBACK = "INVOKE_CALLBACK", 10 | SUBSCRIBE_HANDLER = "SUBSCRIBE_HANDLER" 11 | } 12 | 13 | export interface InvokeArgs { 14 | event: string 15 | params: string 16 | callbackId: number 17 | } 18 | 19 | export interface PublishArgs { 20 | event: string 21 | params: string 22 | webViewId: number 23 | } 24 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/MakePhoneCall.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /packages/webview/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | Evoker - preload - webview 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /packages/shared/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./event" 2 | export { SyncFlags } from "./syncFlags" 3 | export * from "./canvas" 4 | export * from "./devtools" 5 | 6 | export const isNumber = (val: unknown): val is number => typeof val === "number" 7 | 8 | export const isBoolean = (val: unknown): val is number => typeof val === "boolean" 9 | 10 | export const isArrayBuffer = (val: unknown): val is ArrayBuffer => 11 | Object.prototype.toString.call(val) === "[object ArrayBuffer]" 12 | 13 | export const clamp = (value: number, min: number, max: number) => 14 | Math.min(Math.max(min, value), max) 15 | 16 | export const isDevtools = __Config.platform === "devtools" 17 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/GetBatteryInfo.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 23 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Service/AppInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppInfo.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct AppInfo { 12 | 13 | public var appName: String = "" 14 | 15 | public var appIconURL: String = "" 16 | 17 | public var userInfo: [String: Any] = [:] 18 | 19 | public init(appName: String, appIconURL: String, userInfo: [String: Any] = [:]) { 20 | self.appName = appName 21 | self.appIconURL = appIconURL 22 | self.userInfo = userInfo 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/ActionSheet.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 24 | -------------------------------------------------------------------------------- /packages/shared/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@evoker/shared", 3 | "version": "0.13.0", 4 | "type": "module", 5 | "description": "evoker shared", 6 | "author": "yizhi996", 7 | "homepage": "https://github.com/yizhi996/evoker/tree/main/packages/shared", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/yizhi996/evoker.git" 11 | }, 12 | "license": "MIT", 13 | "main": "dist/shared.js", 14 | "module": "dist/shared.js", 15 | "types": "dist/shared.d.ts", 16 | "buildOptions": { 17 | "formats": [ 18 | "es" 19 | ] 20 | }, 21 | "sideEffects": false, 22 | "dependencies": { 23 | "@vue/shared": "^3.2.39" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "private": true, 4 | "version": "0.0.0", 5 | "scripts": { 6 | "dev": "evoker dev", 7 | "build": "evoker build" 8 | }, 9 | "dependencies": { 10 | "@vue/shared": "^3.2.39", 11 | "@evoker/shared": "^0.12.0", 12 | "evoker": "^0.12.0", 13 | "lodash.isequal": "^4.5.0", 14 | "vue": "^3.2.39" 15 | }, 16 | "devDependencies": { 17 | "@evoker/cli": "0.12.0", 18 | "@types/lodash.isequal": "^4.5.6", 19 | "@vitejs/plugin-vue": "^3.1.0", 20 | "typescript": "^4.7.4", 21 | "vite": "^3.1.3" 22 | }, 23 | "browserslist": [ 24 | "iOS >= 11", 25 | "Android >= 7.0" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Modal.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 24 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/index.ts: -------------------------------------------------------------------------------- 1 | import JSBridge from "./bridge" 2 | import { vibrateShort, vibrateLong, authorize, showModal } from "@evoker/bridge" 3 | import { 4 | navigateTo, 5 | navigateBack, 6 | navigateToMiniProgram, 7 | switchTab, 8 | redirectTo, 9 | reLaunch, 10 | exit 11 | } from "./api/navigator" 12 | import { pageScrollTo } from "./api/scroll" 13 | import "./fromService" 14 | 15 | export { 16 | vibrateShort, 17 | vibrateLong, 18 | navigateTo, 19 | navigateBack, 20 | navigateToMiniProgram, 21 | switchTab, 22 | redirectTo, 23 | reLaunch, 24 | exit, 25 | pageScrollTo, 26 | authorize, 27 | showModal 28 | } 29 | 30 | export { JSBridge } 31 | -------------------------------------------------------------------------------- /packages/example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "private": true, 4 | "version": "0.0.0", 5 | "scripts": { 6 | "dev": "evoker dev", 7 | "build": "evoker build" 8 | }, 9 | "dependencies": { 10 | "evoker": "^0.12.0", 11 | "vue": "^3.2.39", 12 | "pinia": "^2.0.14", 13 | "tailwindcss": "^3.0.15" 14 | }, 15 | "devDependencies": { 16 | "@evoker/cli": "^0.12.0", 17 | "@vitejs/plugin-vue": "^3.1.0", 18 | "autoprefixer": "^10.4.2", 19 | "postcss": "^8.4.5", 20 | "typescript": "^4.7.4", 21 | "vite": "^3.1.3", 22 | "vue-tsc": "^0.34.17" 23 | }, 24 | "browserslist": [ 25 | "iOS >= 11", 26 | "Android >= 7.0" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/create-evoker/template-iOS/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | use_frameworks! 4 | 5 | target 'Launcher' do 6 | 7 | pod 'Evoker', '~> 0.13.0' 8 | pod 'Evoker/Map', '~> 0.13.0' 9 | 10 | end 11 | 12 | post_install do |installer| 13 | installer.pods_project.targets.each do |target| 14 | target.build_configurations.each do |config| 15 | config.build_settings['ENABLE_BITCODE'] = 'YES' 16 | end 17 | if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" 18 | target.build_configurations.each do |config| 19 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | use_frameworks! 4 | 5 | target 'Launcher' do 6 | 7 | pod 'Evoker', :path => "../../.." 8 | pod 'Evoker/Map', :path => "../../.." 9 | 10 | end 11 | 12 | post_install do |installer| 13 | installer.pods_project.targets.each do |target| 14 | target.build_configurations.each do |config| 15 | config.build_settings['ENABLE_BITCODE'] = 'YES' 16 | end 17 | if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" 18 | target.build_configurations.each do |config| 19 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/OnNetworkStatusChange.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 25 | -------------------------------------------------------------------------------- /packages/test/src/pages/WebSocket.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 29 | -------------------------------------------------------------------------------- /packages/service/src/bridge/api/html/canvas/utils.ts: -------------------------------------------------------------------------------- 1 | const template = (id: string, script: string) => `(function() { 2 | const wrapper = document.getElementById("${id}"); 3 | if (wrapper) { 4 | const canvas = wrapper.querySelector("canvas"); 5 | ${script} 6 | } 7 | })()` 8 | 9 | const exec = (script: string, webViewId: number) => 10 | globalThis.__NativeSDK.evalWebView(script, webViewId) 11 | 12 | export const execCanvasFunction = (id: string, webViewId: number, func: string) => 13 | exec(template(id, func), webViewId) 14 | 15 | export const execCanvas2DContextFunction = (id: string, webViewId: number, func: string) => 16 | exec(template(id, `const ctx = canvas.getContext("2d");${func}`), webViewId) 17 | -------------------------------------------------------------------------------- /packages/example/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "evoker" 2 | import { createPinia } from "pinia" 3 | import App from "./App.vue" 4 | import NTopic from "./components/NTopic.vue" 5 | import NCellGroup from "./components/NCellGroup.vue" 6 | import NCell from "./components/NCell.vue" 7 | import NObject from "./components/NObject.vue" 8 | 9 | import "./tailwind.css" 10 | 11 | const app = createApp(App) 12 | 13 | app.config.errorHandler = err => { 14 | console.log(err) 15 | } 16 | 17 | const pinia = createPinia() 18 | app.use(pinia) 19 | 20 | app.component("n-topic", NTopic) 21 | app.component("n-cell", NCell) 22 | app.component("n-cell-group", NCellGroup) 23 | app.component("n-object", NObject) 24 | 25 | app.mount("#app") 26 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/UIScrollView+Tongceng.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Tongceng.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | 13 | extension UIScrollView { 14 | 15 | private static var tongcengIdKey = "WK_SCROLL_VIEW_TONGCENG_ID" 16 | 17 | var tongcengId: String? { 18 | get { 19 | objc_getAssociatedObject(self, &UIScrollView.tongcengIdKey) as! String? 20 | } set { 21 | objc_setAssociatedObject(self, &UIScrollView.tongcengIdKey, newValue, .OBJC_ASSOCIATION_COPY_NONATOMIC) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/NSAttributedString+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedString+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension NSAttributedString { 13 | 14 | var rangeOfAll: NSRange { 15 | return NSRange(location: 0, length: string.count) 16 | } 17 | 18 | func calcHeight(width: CGFloat) -> CGFloat { 19 | let rect = boundingRect(with: CGSize(width: width, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin, .usesFontLeading], context: nil) 20 | return rect.height 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/test/src/pages/Base.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 29 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Bridge/API/CanvasAPI.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CanvasAPI.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | enum CanvasAPI: String, CaseIterableAPI { 12 | 13 | case drawCanvas 14 | 15 | func onInvoke(appService: AppService, bridge: JSBridge, args: JSBridge.InvokeArgs) { 16 | switch self { 17 | case .drawCanvas: 18 | drawCanvas(appService: appService, bridge: bridge, args: args) 19 | } 20 | } 21 | 22 | private func drawCanvas(appService: AppService, bridge: JSBridge, args: JSBridge.InvokeArgs) { 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /packages/create-evoker/template-blank/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 33 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/api/scroll.ts: -------------------------------------------------------------------------------- 1 | import JSBridge from "../bridge" 2 | 3 | interface PageScrollToOptions { 4 | scrollTop?: number 5 | duration: number 6 | selector?: string 7 | offsetTop?: number 8 | } 9 | 10 | export function pageScrollTo(options: PageScrollToOptions) { 11 | const { scrollTop, selector, offsetTop, duration } = options 12 | let top = -1 13 | if (selector) { 14 | const el = document.querySelector(selector) as HTMLElement 15 | if (el) { 16 | top = el.offsetTop + el.offsetHeight + (offsetTop || 0) 17 | } 18 | } else if (scrollTop !== undefined) { 19 | top = scrollTop 20 | } 21 | if (top > -1) { 22 | JSBridge.invoke("pageScrollTo", { top, duration }) 23 | } 24 | return Promise.resolve({}) 25 | } 26 | -------------------------------------------------------------------------------- /packages/create-evoker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-evoker", 3 | "version": "0.5.0", 4 | "description": "evoker creator", 5 | "author": "yizhi996", 6 | "homepage": "https://github.com/yizhi996/evoker/tree/main/packages/create-evoker", 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/yizhi996/evoker.git" 10 | }, 11 | "license": "MIT", 12 | "main": "index.js", 13 | "type": "module", 14 | "bin": { 15 | "create-evoker": "index.js" 16 | }, 17 | "dependencies": { 18 | "execa": "^6.1.0", 19 | "inquirer": "^9.0.0", 20 | "minimist": "^1.2.6", 21 | "which-pm-runs": "^1.1.0" 22 | }, 23 | "files": [ 24 | "index.js", 25 | "_gitignore", 26 | "_README.md", 27 | "template-*" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Animation.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | -------------------------------------------------------------------------------- /packages/bridge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@evoker/bridge", 3 | "version": "0.13.0", 4 | "type": "module", 5 | "description": "evoker js bridge", 6 | "author": "yizhi996", 7 | "homepage": "https://github.com/yizhi996/evoker/tree/main/packages/bridge", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/yizhi996/evoker.git" 11 | }, 12 | "license": "MIT", 13 | "main": "dist/bridge.js", 14 | "module": "dist/bridge.js", 15 | "types": "dist/bridge.d.ts", 16 | "buildOptions": { 17 | "formats": [ 18 | "es" 19 | ] 20 | }, 21 | "sideEffects": false, 22 | "files": [ 23 | "dist" 24 | ], 25 | "dependencies": { 26 | "@evoker/shared": "0.13.0", 27 | "vue": "^3.2.39", 28 | "@vue/shared": "^3.2.39" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/VModel.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 25 | -------------------------------------------------------------------------------- /scripts/dev.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { build } from "vite" 3 | import { resolve } from "path" 4 | import minimist from "minimist" 5 | import { allPakcages, packageDirectory } from "./utils.js" 6 | 7 | const args = minimist(process.argv.slice(2)) 8 | 9 | const target = args._[0] 10 | 11 | const targets = allPakcages().filter(p => p !== "create-evoker" && p !== "vue") 12 | 13 | if (!target) { 14 | targets.forEach(buildTarget) 15 | } else { 16 | buildTarget(target) 17 | } 18 | 19 | async function buildTarget(target) { 20 | const pkgDir = packageDirectory(target) 21 | return await build({ 22 | configFile: resolve(pkgDir, "vite.config.ts"), 23 | root: pkgDir, 24 | mode: "development", 25 | build: { 26 | minify: false, 27 | watch: {} 28 | } 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Navigator.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 30 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Clipboard.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | -------------------------------------------------------------------------------- /packages/launcher/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "launcher", 3 | "private": true, 4 | "version": "0.0.0", 5 | "scripts": { 6 | "dev": "evoker dev", 7 | "build": "evoker build" 8 | }, 9 | "dependencies": { 10 | "@evoker/shared": "^0.12.0", 11 | "@vue/shared": "^3.2.39", 12 | "evoker": "^0.12.0", 13 | "pinia": "^2.0.14", 14 | "tailwindcss": "^3.0.15", 15 | "url-parse": "^1.5.10", 16 | "vue": "^3.2.39" 17 | }, 18 | "devDependencies": { 19 | "@evoker/cli": "0.12.0", 20 | "@types/url-parse": "^1.4.8", 21 | "@vitejs/plugin-vue": "^3.1.0", 22 | "autoprefixer": "^10.4.2", 23 | "postcss": "^8.4.5", 24 | "typescript": "^4.7.4", 25 | "vite": "^3.1.3" 26 | }, 27 | "browserslist": [ 28 | "iOS >= 11", 29 | "Android >= 7.0" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/loading/Loading.tsx: -------------------------------------------------------------------------------- 1 | import { computed, defineComponent } from "vue" 2 | import { unitToPx } from "../../utils/format" 3 | 4 | const props = { 5 | size: { type: [Number, String], default: 20 }, 6 | color: { type: String, default: "#fff" } 7 | } 8 | 9 | export default defineComponent({ 10 | name: "ek-loading", 11 | props, 12 | setup(props) { 13 | const size = computed(() => { 14 | return `${unitToPx(props.size)}px` 15 | }) 16 | 17 | return () => ( 18 |
19 | 20 | 21 | 22 |
23 | ) 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /packages/create-evoker/README.md: -------------------------------------------------------------------------------- 1 | # create-evoker 2 | 3 | 快速创建 Evoker 应用脚手架。 4 | 5 | ### 创建空白脚手架 6 | 7 | ``` 8 | // use npm 9 | npm create evoker my-app --template blank --platform iOS 10 | 11 | // use yarn 12 | yarn create evoker my-app --template blank --platform iOS 13 | 14 | // use pnpm 15 | pnpm create evoker my-app --template blank --platform iOS 16 | ``` 17 | 18 | ### 其他模板 `--template` 19 | 20 | * example 包含所有内置组件和大部分 API 的示例 21 | 22 | ### 启动应用 23 | 24 | 1. 启动 Node 项目 25 | ``` 26 | cd my-app 27 | 28 | // 安装依赖 29 | npm / yarn /pnpm install 30 | 31 | // 启动 dev server 32 | npm / yarn /pnpm run dev 33 | ``` 34 | 35 | 2. 启动 iOS 36 | ``` 37 | cd my-app/iOS 38 | 39 | // 安装 iOS 依赖 40 | pod install 41 | ``` 42 | 43 | 3. 打开 `iOS/${projectName}.xcworkspace` 运行在指定设备或者模拟器 44 | 45 | * 如果要在真机运行,请设置 Bundle Identifier 和 签名证书 -------------------------------------------------------------------------------- /packages/service/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@evoker/service", 3 | "version": "0.13.0", 4 | "type": "module", 5 | "description": "evoker jscore runtime", 6 | "author": "yizhi996", 7 | "homepage": "https://github.com/yizhi996/evoker/tree/main/packages/service", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/yizhi996/evoker.git" 11 | }, 12 | "license": "MIT", 13 | "main": "dist/service.js", 14 | "module": "dist/service.js", 15 | "types": "dist/service.d.ts", 16 | "sideEffects": false, 17 | "buildOptions": { 18 | "formats": [ 19 | "es" 20 | ] 21 | }, 22 | "dependencies": { 23 | "@evoker/bridge": "0.13.0", 24 | "@evoker/shared": "0.13.0", 25 | "vue": "^3.2.39", 26 | "@vue/shared": "^3.2.39" 27 | }, 28 | "files": [ 29 | "dist" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Resources/Image.xcassets/tab-bar-item-badge.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "tab-bar-item-badge@3x.png", 13 | "idiom" : "universal", 14 | "resizing" : { 15 | "cap-insets" : { 16 | "bottom" : 45, 17 | "left" : 44, 18 | "right" : 45, 19 | "top" : 44 20 | }, 21 | "center" : { 22 | "height" : 1, 23 | "mode" : "tile", 24 | "width" : 1 25 | }, 26 | "mode" : "9-part" 27 | }, 28 | "scale" : "3x" 29 | } 30 | ], 31 | "info" : { 32 | "author" : "xcode", 33 | "version" : 1 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /iOS/Evoker/Sources/Extension/TimeInterval+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TimeInterval+Extension.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | extension TimeInterval { 12 | 13 | func secondsToHoursMinutesSeconds () -> (Int, Int, Int) { 14 | let seconds = Int(self) 15 | return (seconds / 3600, (seconds % 3600) / 60, (seconds % 3600) % 60) 16 | } 17 | 18 | func secondsToHoursMinutesSecondsDisplay () -> String { 19 | let (h, m, s) = secondsToHoursMinutesSeconds() 20 | var result = String(format: "%02d:%02d", m, s) 21 | if h > 0 { 22 | result = String(format: "%02d:", h) + result 23 | } 24 | return result 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /iOS/EvokerMap/Sources/MapModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapModule.swift 3 | // 4 | // Copyright (c) Evoker. All rights reserved. (https://evokerdev.com) 5 | // 6 | // This source code is licensed under The MIT license. 7 | // 8 | 9 | import Foundation 10 | 11 | public class MapModule: Module { 12 | 13 | public static var name: String { 14 | return "com.evokerdev.module.map" 15 | } 16 | 17 | public static var apis: [String : API] { 18 | var result: [String : API] = [:] 19 | MapAPI.allCases.forEach { result[$0.rawValue] = $0 } 20 | return result 21 | } 22 | 23 | var mapViews: [Int: MapView] = [:] 24 | 25 | public required init(appService: AppService) { 26 | 27 | } 28 | 29 | public func onUnload(_ page: Page) { 30 | mapViews[page.pageId] = nil 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/api/canvas.ts: -------------------------------------------------------------------------------- 1 | import { isEvokerElement, nodes } from "../../dom/element" 2 | 3 | interface ExecCanvasCommandOptions { 4 | nodeId: number 5 | commands: any[] 6 | } 7 | 8 | export function execCanvasCommand(options: ExecCanvasCommandOptions) { 9 | const node = nodes.get(options.nodeId) 10 | if (node && isEvokerElement(node.el)) { 11 | node.el.__instance!.exposed!.exec(options) 12 | } 13 | return Promise.resolve({}) 14 | } 15 | 16 | interface OperateCanvasOptions { 17 | nodeId: number 18 | method: string 19 | data: Record 20 | } 21 | 22 | export function operateCanvas(options: OperateCanvasOptions) { 23 | const node = nodes.get(options.nodeId) 24 | if (node && isEvokerElement(node.el)) { 25 | node.el.__instance!.exposed!.operate(options) 26 | } 27 | return Promise.resolve({}) 28 | } 29 | -------------------------------------------------------------------------------- /packages/webview/src/bridge/api/font.ts: -------------------------------------------------------------------------------- 1 | interface LoadFontFaceDesc { 2 | style?: string 3 | weight?: string 4 | variant?: string 5 | } 6 | 7 | interface LoadFontFaceOptions { 8 | family: string 9 | source: string 10 | desc: LoadFontFaceDesc 11 | } 12 | 13 | export function loadFontFace(options: LoadFontFaceOptions) { 14 | return new Promise((resolve, reject) => { 15 | const { family, source, desc } = options 16 | const font = new FontFace(family, source, desc) 17 | font 18 | .load() 19 | .then( 20 | () => { 21 | // @ts-ignore 22 | document.fonts.add(font) 23 | resolve({ status: font.status }) 24 | }, 25 | () => { 26 | reject(font.status) 27 | } 28 | ) 29 | .catch(() => { 30 | reject(font.status) 31 | }) 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/VideoButton/VideoButton.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent, PropType, withDirectives, VNode } from "vue" 2 | import { vTap } from "../../../directive/tap" 3 | import { classNames } from "../../../utils" 4 | 5 | export default defineComponent({ 6 | props: { 7 | type: String as PropType< 8 | "play" | "pause" | "mute-on" | "mute-off" | "fullscreen" | "back" | "lock" | "unlock" 9 | > 10 | }, 11 | emits: ["click"], 12 | setup(props, { emit }) { 13 | const onClick = () => { 14 | emit("click") 15 | } 16 | 17 | return () => { 18 | return withDirectives( 19 | ( 20 |
21 | ) as VNode, 22 | [[vTap, onClick, "", { stop: true }]] 23 | ) 24 | } 25 | } 26 | }) 27 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/GetSystemInfo.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | -------------------------------------------------------------------------------- /packages/example/src/store.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue" 2 | import { defineStore } from "pinia" 3 | import { ramdomString } from "./utils" 4 | 5 | export const useLocalStore = defineStore("local", () => { 6 | const deviceId = ref("") 7 | 8 | const KEY = "k_device_id" 9 | 10 | async function getDeviceId() { 11 | if (deviceId.value === "") { 12 | const init = () => { 13 | deviceId.value = ramdomString(12) 14 | ek.setStorage({ key: KEY, data: deviceId.value }) 15 | } 16 | try { 17 | const res = await ek.getStorage({ key: KEY }) 18 | if (res.data) { 19 | deviceId.value = res.data 20 | } else { 21 | init() 22 | } 23 | } catch { 24 | init() 25 | } 26 | } 27 | return deviceId.value 28 | } 29 | 30 | return { 31 | getDeviceId 32 | } 33 | }) 34 | -------------------------------------------------------------------------------- /packages/example/src/utils.ts: -------------------------------------------------------------------------------- 1 | export function formatSecond(time: number) { 2 | if (typeof time !== "number" || time < 0) { 3 | return time 4 | } 5 | 6 | const hour = Math.floor(time / 3600) 7 | time %= 3600 8 | const minute = Math.floor(time / 60) 9 | time = Math.floor(time % 60) 10 | const second = time 11 | 12 | return [hour, minute, second] 13 | .map(x => { 14 | const y = x.toString() 15 | return y[1] ? y : "0" + y 16 | }) 17 | .join(":") 18 | } 19 | 20 | export function ramdomString(length: number) { 21 | let result = "" 22 | let characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 23 | const charactersLength = characters.length 24 | for (let i = 0; i < length; i++) { 25 | result += characters.charAt(Math.floor(Math.random() * charactersLength)) 26 | } 27 | return result 28 | } 29 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "cSpell.enabledLanguageIds": [ 4 | "markdown", 5 | "plaintext", 6 | "text", 7 | "yml" 8 | ], 9 | "[typescript]": { 10 | "editor.defaultFormatter": "esbenp.prettier-vscode" 11 | }, 12 | "[javascript]": { 13 | "editor.defaultFormatter": "esbenp.prettier-vscode" 14 | }, 15 | "[json]": { 16 | "editor.defaultFormatter": "esbenp.prettier-vscode" 17 | }, 18 | "[vue]": { 19 | "editor.defaultFormatter": "esbenp.prettier-vscode" 20 | }, 21 | "files.exclude": { 22 | "**/.git": true, 23 | "**/.svn": true, 24 | "**/.hg": true, 25 | "**/CVS": true, 26 | "**/.DS_Store": true, 27 | "**/Thumbs.db": true, 28 | "**/node_modules": false 29 | } 30 | } -------------------------------------------------------------------------------- /packages/devtools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@evoker/devtools", 3 | "version": "0.13.0", 4 | "description": "evoker devtools", 5 | "author": "yizhi996", 6 | "homepage": "https://github.com/yizhi996/evoker/tree/main/packages/devtools", 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/yizhi996/evoker.git" 10 | }, 11 | "license": "MIT", 12 | "main": "dist/devtools.js", 13 | "module": "dist/devtools.js", 14 | "types": "dist/devtools.d.ts", 15 | "buildOptions": { 16 | "name": "__Devtools", 17 | "formats": [ 18 | "iife" 19 | ] 20 | }, 21 | "dependencies": { 22 | "@evoker/bridge": "0.13.0", 23 | "@evoker/shared": "0.13.0", 24 | "@vue/shared": "^3.2.39", 25 | "hammer-touchemulator": "^0.0.2", 26 | "ws": "^8.8.0" 27 | }, 28 | "devDependencies": { 29 | "@types/ws": "^8.5.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": [ 14 | "esnext", 15 | "dom" 16 | ], 17 | "skipLibCheck": true, 18 | "paths": { 19 | "@evoker/*": [ 20 | "../*/src" 21 | ], 22 | "evoker": [ 23 | "../evoker/src" 24 | ] 25 | }, 26 | }, 27 | "include": [ 28 | "src/**/*.ts", 29 | "src/**/*.d.ts", 30 | "src/**/*.tsx", 31 | "src/**/*.vue", 32 | "../evoker/global.d.ts" 33 | ], 34 | "references": [ 35 | { 36 | "path": "./tsconfig.node.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /packages/example/src/pages/API/IntersectionObserver.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 28 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/Toast.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 34 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/movable-area/MovableArea.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent, ref, watch } from "vue" 2 | import { useChildren } from "../../composables/useRelation" 3 | import { MOVABLE_KEY } from "./constant" 4 | 5 | export default defineComponent({ 6 | name: "ek-movable-area", 7 | setup() { 8 | const container = ref() 9 | 10 | const { children, linkChildren } = useChildren(MOVABLE_KEY) 11 | 12 | linkChildren({}) 13 | 14 | watch( 15 | () => [...children], 16 | children => { 17 | if (!container.value) { 18 | return 19 | } 20 | const rect = container.value.getBoundingClientRect() 21 | children.forEach(child => { 22 | child.exposed!.setAreaRect(rect) 23 | }) 24 | } 25 | ) 26 | 27 | return () => 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /packages/service/src/runtime-jscore/modules/class.ts: -------------------------------------------------------------------------------- 1 | import { EvokerElement } from "../../dom/element" 2 | 3 | export interface ElementWithTransition extends EvokerElement { 4 | // _vtc = Vue Transition Classes. 5 | // Store the temporarily-added transition classes on the element 6 | // so that we can avoid overwriting them if the element's class is patched 7 | // during the transition. 8 | _vtc?: Set 9 | } 10 | 11 | export function patchClass(el: EvokerElement, value: string | null, isSVG: boolean) { 12 | const transitionClasses = (el as ElementWithTransition)._vtc 13 | if (transitionClasses) { 14 | value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ") 15 | } 16 | if (value == null) { 17 | el.className = "" 18 | el.removeAttribute("class") 19 | } else { 20 | el.className = value 21 | el.setAttribute("class", value) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/bridge/src/errors.ts: -------------------------------------------------------------------------------- 1 | import { isString } from "@vue/shared" 2 | 3 | const getNameType = (name: string) => (name.includes(".") ? "property" : "argument") 4 | 5 | export const ERR_INVALID_ARG_TYPE = (name: string, types: string | string[], actual: unknown) => 6 | `The "${name}" ${getNameType(name)} must be of type ${ 7 | isString(types) ? types : types.join(" or") 8 | }. Received ${actual}` 9 | 10 | export const ERR_CANNOT_EMPTY = "cannot be empty" 11 | 12 | export const ERR_INVALID = (name: string) => `${name} invalid` 13 | 14 | export const ERR_INVALID_ARG_VALUE = ( 15 | name: string, 16 | value: unknown, 17 | reason: string = "is invalid" 18 | ) => `The "${name}" ${getNameType(name)} ${reason}, Received ${value}` 19 | 20 | export const ERR_OUT_OF_RANGE = (name: string, input: unknown, range: string) => 21 | `The value of "${name}" is out of range. It must be ${range}. Received ${input}` 22 | -------------------------------------------------------------------------------- /packages/launcher/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": [ 14 | "esnext", 15 | "dom" 16 | ], 17 | "skipLibCheck": true, 18 | "paths": { 19 | "@evoker/*": [ 20 | "../*/src" 21 | ], 22 | "evoker": [ 23 | "../evoker/src" 24 | ] 25 | }, 26 | }, 27 | "include": [ 28 | "src/**/*.ts", 29 | "src/**/*.d.ts", 30 | "src/**/*.tsx", 31 | "src/**/*.vue", 32 | "../evoker/global.d.ts", 33 | "../bridge/global.d.ts" 34 | ], 35 | "references": [ 36 | { 37 | "path": "./tsconfig.node.json" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /packages/webview/src/element/components/video/VideoScreenBrightness/VideoScreenBrightness.tsx: -------------------------------------------------------------------------------- 1 | import { clamp } from "@evoker/shared" 2 | import { computed, defineComponent } from "vue" 3 | 4 | export default defineComponent({ 5 | props: { 6 | value: { type: Number, default: 0 } 7 | }, 8 | setup(props) { 9 | const count = computed(() => { 10 | return clamp(Math.floor(props.value * 100 * 0.15), 0, 15) 11 | }) 12 | return () => { 13 | const indicator = [...Array(count.value).keys()].map(i => ( 14 | 15 | )) 16 | return ( 17 |
18 |
亮度
19 |
20 |
{indicator}
21 |
22 | ) 23 | } 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /packages/bridge/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { isPlainObject } from "@vue/shared" 2 | 3 | export function combineOptions, U = Record>( 4 | options: T, 5 | preset: U 6 | ): T & U { 7 | const res: Record = preset 8 | for (const key in options) { 9 | const value = options[key] 10 | if (value != null) { 11 | res[key] = isPlainObject(value) 12 | ? combineOptions(value, (preset as Record)[key]) 13 | : value 14 | } else { 15 | res[key] = (preset as Record)[key] 16 | } 17 | } 18 | return res as T & U 19 | } 20 | 21 | export function fetchArrayBuffer(data: any, key: string) { 22 | const { __arrayBuffer__ } = data 23 | if (__arrayBuffer__) { 24 | delete data.__arrayBuffer__ 25 | 26 | const arrayBuffer = globalThis.__ArrayBufferRegister.get(__arrayBuffer__) 27 | data[key] = arrayBuffer 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/loading/Loading.less: -------------------------------------------------------------------------------- 1 | .ek-loading { 2 | display: inline-block; 3 | position: relative; 4 | animation: rotate 2s linear infinite; 5 | 6 | &__circle { 7 | display: block; 8 | width: 100%; 9 | height: 100%; 10 | 11 | > circle { 12 | stroke: currentColor; 13 | stroke-width: 3; 14 | stroke-linecap: round; 15 | animation: circular 1.5s ease-in-out infinite; 16 | } 17 | } 18 | } 19 | 20 | @keyframes rotate { 21 | 0% { 22 | transform: rotate(0); 23 | } 24 | 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @keyframes circular { 31 | 0% { 32 | stroke-dasharray: 1, 200; 33 | stroke-dashoffset: 0; 34 | } 35 | 36 | 50% { 37 | stroke-dasharray: 90, 150; 38 | stroke-dashoffset: -40; 39 | } 40 | 41 | to { 42 | stroke-dasharray: 90, 150; 43 | stroke-dashoffset: -120; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/view/View.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent, PropType, ref } from "vue" 2 | import { useHover } from "../../composables/useHover" 3 | import { useCSSAnimation, AnimationAction } from "../../composables/useCSSAnimation" 4 | 5 | const props = { 6 | hoverClass: { type: String, default: "none" }, 7 | hoverStopPropagation: { type: Boolean, default: false }, 8 | hoverStartTime: { type: Number, default: 50 }, 9 | hoverStayTime: { type: Number, default: 400 }, 10 | animation: { type: Array as PropType, default: () => [] } 11 | } 12 | 13 | export default defineComponent({ 14 | name: "ek-view", 15 | props, 16 | setup(props) { 17 | const el = ref() 18 | 19 | const { finalHoverClass } = useHover(el, props) 20 | 21 | useCSSAnimation(el, props) 22 | 23 | return () => 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/ScreenBrightness.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 35 | -------------------------------------------------------------------------------- /packages/bridge/src/pipeline.ts: -------------------------------------------------------------------------------- 1 | import { publish, subscribe } from "./bridge" 2 | import { queuePostFlushCb } from "vue" 3 | 4 | const Method = "vdSync" 5 | 6 | const queues = new Map() 7 | 8 | const jobs = new Map() 9 | 10 | function flush(pageId: number) { 11 | const messages = queues.get(pageId) 12 | publish(Method, messages, pageId) 13 | queues.delete(pageId) 14 | jobs.delete(pageId) 15 | } 16 | 17 | export function sync(message: any, pageId: number) { 18 | const messages = queues.get(pageId) 19 | if (messages) { 20 | messages.push(message) 21 | } else { 22 | queues.set(pageId, [message]) 23 | } 24 | 25 | let job = jobs.get(pageId) 26 | if (!job) { 27 | job = flush.bind(null, pageId) 28 | jobs.set(pageId, job) 29 | } 30 | queuePostFlushCb(job) 31 | } 32 | 33 | export function onSync(callback: (messages: any[]) => void) { 34 | subscribe(Method, callback) 35 | } 36 | -------------------------------------------------------------------------------- /packages/launcher/src/components/NavigationBar.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 29 | -------------------------------------------------------------------------------- /packages/example/src/pages/API/LoadFontFace.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 28 | 29 | 34 | -------------------------------------------------------------------------------- /packages/webview/src/dom/vnode.ts: -------------------------------------------------------------------------------- 1 | import { VNode } from "vue" 2 | 3 | export interface EvokerEventListenerOptions { 4 | options?: EventListenerOptions 5 | modifiers?: string[] 6 | } 7 | 8 | export interface EvokerVNode { 9 | nodeId: number 10 | tagName: string 11 | className: string 12 | id: string 13 | attributes: Record 14 | listeners: Record 15 | textContent: string 16 | style: string 17 | data: string 18 | isSVG: boolean 19 | vnode?: VNode 20 | el?: any 21 | props?: Record 22 | } 23 | 24 | export function restoreNode(data: any[]) { 25 | const node: EvokerVNode = { 26 | nodeId: data[0], 27 | tagName: data[1], 28 | className: data[2], 29 | id: data[3], 30 | attributes: data[4], 31 | listeners: data[5], 32 | textContent: data[6], 33 | style: data[7], 34 | data: data[8], 35 | isSVG: data[9] 36 | } 37 | return node 38 | } 39 | -------------------------------------------------------------------------------- /packages/webview/src/element/components/input-html/InputHTML.less: -------------------------------------------------------------------------------- 1 | ek-input div { 2 | position: relative; 3 | height: inherit; 4 | margin: 0; 5 | padding: 0; 6 | min-height: 100%; 7 | } 8 | 9 | .ek-input { 10 | &__html { 11 | background: transparent; 12 | border: none; 13 | display: inherit; 14 | position: relative; 15 | width: 100%; 16 | height: inherit; 17 | min-height: 100%; 18 | margin: 0; 19 | padding: 0; 20 | outline: none; 21 | overflow: inherit; 22 | text-overflow: inherit; 23 | vertical-align: middle; 24 | white-space: inherit; 25 | z-index: 2; 26 | 27 | &__placeholder { 28 | position: absolute; 29 | left: 0; 30 | top: 0; 31 | width: 100%; 32 | height: inherit; 33 | min-height: 100%; 34 | line-height: 100%; 35 | overflow: hidden; 36 | vertical-align: middle; 37 | white-space: pre; 38 | z-index: 1; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/example/src/pages/Component/Progress.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | -------------------------------------------------------------------------------- /packages/evoker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "evoker", 3 | "version": "0.13.0", 4 | "type": "module", 5 | "description": "The Vue mini program engine", 6 | "author": "yizhi996", 7 | "homepage": "https://github.com/yizhi996/evoker", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/yizhi996/evoker.git" 11 | }, 12 | "license": "MIT", 13 | "main": "dist/evoker.js", 14 | "module": "dist/evoker.js", 15 | "types": "dist/global.d.ts", 16 | "sideEffects": false, 17 | "keywords": [ 18 | "evoker", 19 | "vue", 20 | "mini-program", 21 | "mini-app" 22 | ], 23 | "buildOptions": { 24 | "name": "Evoker", 25 | "formats": [ 26 | "iife", 27 | "es" 28 | ] 29 | }, 30 | "dependencies": { 31 | "vue": "^3.2.39", 32 | "@evoker/service": "0.13.0", 33 | "@evoker/webview": "0.13.0" 34 | }, 35 | "devDependencies": { 36 | "vite": "^3.1.3" 37 | }, 38 | "files": [ 39 | "dist" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /packages/launcher/iOS/Launcher/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Launcher 4 | // 5 | 6 | import UIKit 7 | @main 8 | 9 | class AppDelegate: UIResponder, UIApplicationDelegate { 10 | 11 | var window: UIWindow? 12 | 13 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 14 | 15 | window = UIWindow(frame: UIScreen.main.bounds) 16 | window!.makeKeyAndVisible() 17 | 18 | window!.rootViewController = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController() 19 | 20 | DispatchQueue.main.async { 21 | Launcher.shared.setupEvoker() 22 | } 23 | 24 | return true 25 | } 26 | 27 | func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { 28 | return .all 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/example/src/pages/Component/Textarea.vue: -------------------------------------------------------------------------------- 1 |