Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 28 additions & 43 deletions demo/app/App.svelte
Original file line number Diff line number Diff line change
@@ -1,48 +1,33 @@
<radSideDrawer bind:this={drawer}>
<radSideDrawer.drawerContent>
<gridLayout rows="auto, *" >
<label row="0" padding="10" class="h2" horizontalAlignment="left">Examples</label>
<label row="0" class="fas h2" text="&#xf00d;" padding="10" horizontalAlignment="right" on:tap={() => drawer.closeDrawer()} />
<scrollView row="1" >
<stackLayout>
<label text="ListView" class:current={$current_page == ListViewPage} padding="10" on:tap="{() => gotoPage(ListViewPage)}" />
<label text="Text Nodes" class:current={$current_page == TextNodePage} padding="10" on:tap="{() => gotoPage(TextNodePage)}" />
<label text="SegmentedBar" class:current={$current_page == SegmentedBarPage} padding="10" on:tap="{() => gotoPage(SegmentedBarPage)}" />
<label text="Formatted String" class:current={$current_page == FormattedStringPage} padding="10" on:tap="{() => gotoPage(FormattedStringPage)}" />
<label text="Transitions" class:current={$current_page == TransitionsPage} padding="10" on:tap="{() => gotoPage(TransitionsPage)}" />
</stackLayout>
</scrollView>
</gridLayout>
</radSideDrawer.drawerContent>
<radSideDrawer.mainContent>
<frame id="navframe" defaultPage={ListViewPage}></frame>
</radSideDrawer.mainContent>
</radSideDrawer>
<page>
<actionBar title="Svelte 5 + NativeScript" class="bg-purple-800 text-white" />
<tabView selectedIndex={selectedTab} onselectedIndexChange={(e) => selectedTab = e.value}>
<tabViewItem title="Reactivity" iconSource={tabIcons.reactivity} class="text-sm">
<ReactivityPage />
</tabViewItem>
<tabViewItem title="Stores" iconSource={tabIcons.stores} class="text-sm">
<StoresPage />
</tabViewItem>
<tabViewItem title="Controls" iconSource={tabIcons.controls} class="text-sm">
<ControlsPage />
</tabViewItem>
<tabViewItem title="About" iconSource={tabIcons.about} class="text-sm">
<AboutPage />
</tabViewItem>
</tabView>
</page>

<script>
import { onMount } from 'svelte'
import * as nav from './Nav'
import ListViewPage from './pages/ListViewPage.svelte'
import TextNodePage from './pages/TextNodePage.svelte'
import SegmentedBarPage from './pages/SegmentedBarPage.svelte'
import FormattedStringPage from './pages/FormattedStringPage.svelte'
import TransitionsPage from './pages/TransitionsPage.svelte'
import ReactivityPage from './pages/ReactivityPage.svelte'
import StoresPage from './pages/StoresPage.svelte'
import ControlsPage from './pages/ControlsPage.svelte'
import AboutPage from './pages/AboutPage.svelte'

function gotoPage(page) {
drawer.closeDrawer();
nav.goto(page);
}

let drawer;
let current_page = nav.current_page
const tabIcons = {
reactivity: __APPLE__ ? 'sys://figure.jumprope.circle.fill' : 'res://ic_tab_reactivity',
stores: __APPLE__ ? 'sys://storefront.fill' : 'res://ic_tab_stores',
controls: __APPLE__ ? 'sys://gamecontroller.fill' : 'res://ic_tab_controls',
about: __APPLE__ ? 'sys://info.circle.fill' : 'res://ic_tab_about',
};

onMount(() => {
nav.init("navframe", drawer, ListViewPage)
})
let selectedTab = 0;
</script>

<style>
.current {
font-weight: bold;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M12,3.5C7.31,3.5 3.5,7.31 3.5,12C3.5,16.69 7.31,20.5 12,20.5C16.69,20.5 20.5,16.69 20.5,12C20.5,7.31 16.69,3.5 12,3.5Z"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M12,10.8V15"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#222222"
android:pathData="M12,8.2m-0.9,0a0.9,0.9 0 1,1 1.8,0a0.9,0.9 0 1,1 -1.8,0" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M7.6,8.5H16.4C18.1,8.5 19.6,9.7 20,11.4L20.5,13.7C20.9,15.7 19.4,17.5 17.4,17.5C16.5,17.5 15.7,17.2 15,16.6L13.8,15.5H10.2L9,16.6C8.3,17.2 7.5,17.5 6.6,17.5C4.6,17.5 3.1,15.7 3.5,13.7L4,11.4C4.4,9.7 5.9,8.5 7.6,8.5Z"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M8.4,12.2H11.2M9.8,10.8V13.6"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#222222"
android:pathData="M15.6,11.3m-0.9,0a0.9,0.9 0 1,1 1.8,0a0.9,0.9 0 1,1 -1.8,0" />
<path
android:fillColor="#222222"
android:pathData="M17.6,13.3m-0.9,0a0.9,0.9 0 1,1 1.8,0a0.9,0.9 0 1,1 -1.8,0" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M5,13C5,8.03 8.13,4.5 12,4.5C15.87,4.5 19,8.03 19,13"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M9.1,13.4L7.9,14.8M16.9,13.4L18.1,14.8"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M12,10.1L12,13.3M10.2,11.5L13.8,11.5M12,13.3L10.1,16.3M12,13.3L13.9,16.3"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#222222"
android:pathData="M12,8.4m-1.4,0a1.4,1.4 0 1,1 2.8,0a1.4,1.4 0 1,1 -2.8,0" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M4.5,10.2L5.8,6.2H18.2L19.5,10.2"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M7,6.8L7,10.7M10,6.8L10,10.7M14,6.8L14,10.7M17,6.8L17,10.7"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M6.3,10.7V18.5H17.7V10.7"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
<path
android:fillColor="#00000000"
android:pathData="M10.3,18.5V14.6H13.7V18.5"
android:strokeColor="#222222"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:strokeWidth="1.8" />
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "Back.png",
"idiom" : "reality",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"layers" : [
{
"filename" : "Front.solidimagestacklayer"
},
{
"filename" : "Middle.solidimagestacklayer"
},
{
"filename" : "Back.solidimagestacklayer"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "Middle.png",
"idiom" : "reality",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions demo/app/App_Resources/visionOS/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
45 changes: 45 additions & 0 deletions demo/app/App_Resources/visionOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>∂
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
3 changes: 3 additions & 0 deletions demo/app/App_Resources/visionOS/build.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
10 changes: 10 additions & 0 deletions demo/app/App_Resources/visionOS/src/NativeScriptApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import SwiftUI

@main
struct NativeScriptApp: App {

var body: some Scene {
NativeScriptMainWindow()
.defaultSize(width: 700, height: 800)
}
}
14 changes: 0 additions & 14 deletions demo/app/Header.svelte

This file was deleted.

30 changes: 0 additions & 30 deletions demo/app/Nav.ts

This file was deleted.

Loading