Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .changeset/angry-buckets-chew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@lynx-js/web-explorer": patch
---

fix: delay 500ms to send the `webExplorerReady`
fix: create a new lynx-view for lynxjs.org
1 change: 0 additions & 1 deletion .changeset/bright-forks-try.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@lynx-js/react-webpack-plugin": patch
"@lynx-js/web-constants": patch
"@lynx-js/web-elements": patch
"@lynx-js/react-rsbuild-plugin": patch
---

feat: fully support MTS
Expand Down
5 changes: 5 additions & 0 deletions .changeset/eager-wasps-bet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-elements": patch
---

fix: position:fixed not work in scroll-view
5 changes: 0 additions & 5 deletions .changeset/hip-pianos-smash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lucky-laws-wink.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/pretty-coats-bet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-elements": patch
---

fix: add mode: no-cors of fetch in x-audio-tt
5 changes: 5 additions & 0 deletions .changeset/thin-bags-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lynx-js/rspeedy': patch
---

Bump Rsbuild v1.3.8 with Rspack v1.3.5.
6 changes: 6 additions & 0 deletions .changeset/wide-towns-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lynx-js/web-mainthread-apis": patch
"@lynx-js/web-core": patch
---

fix: crash on removing a id attribute
11 changes: 7 additions & 4 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ jobs:
env:
CLEAN_BASE_REF: ${{ steps.git-refs.outputs.base-ref }}
CLEAN_HEAD_REF: ${{ steps.git-refs.outputs.head-ref }}
UPSTREAM_REMOTE: ${{ github.server_url }}/${{ github.repository }}
run: |
git fetch --progress --depth=1 origin "+refs/heads/$CLEAN_BASE_REF:refs/heads/$CLEAN_BASE_REF"
git remote add upstream $UPSTREAM_REMOTE
git fetch --progress --depth=1 upstream "+refs/heads/$CLEAN_BASE_REF:refs/remotes/upstream/$CLEAN_BASE_REF"
MAX_ATTEMPTS=10
ATTEMPT=0
while [ -z "$( git merge-base "refs/heads/$CLEAN_BASE_REF" "$CLEAN_HEAD_REF" )" ] && [ "$ATTEMPT" -lt "$MAX_ATTEMPTS" ]; do
git fetch -q --deepen=10 origin "refs/heads/$CLEAN_BASE_REF" "$CLEAN_HEAD_REF"
while [ -z "$( git merge-base "refs/remotes/upstream/$CLEAN_BASE_REF" "$CLEAN_HEAD_REF" )" ] && [ "$ATTEMPT" -lt "$MAX_ATTEMPTS" ]; do
git fetch -q --deepen=10 upstream "refs/heads/$CLEAN_BASE_REF:refs/remotes/upstream/$CLEAN_BASE_REF"
git fetch -q --deepen=10 origin "$CLEAN_HEAD_REF"
ATTEMPT=$((ATTEMPT + 1))
done
if [ "$ATTEMPT" -ge "$MAX_ATTEMPTS" ]; then
Expand All @@ -52,7 +55,7 @@ jobs:
- name: Get merge base
id: merge-base
env:
CLEAN_BASE_REF: ${{ format('origin/{0}', steps.git-refs.outputs.base-ref) || github.event.base }}
CLEAN_BASE_REF: ${{ format('upstream/{0}', steps.git-refs.outputs.base-ref) || github.event.base }}
CLEAN_HEAD_REF: ${{ steps.git-refs.outputs.head-ref }}
run: |
echo "merge-base=$(git merge-base "$CLEAN_BASE_REF" "$CLEAN_HEAD_REF" || git rev-parse "$CLEAN_BASE_REF")" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@changesets/cli": "^2.29.0",
"@changesets/cli": "^2.29.2",
"@codspeed/vitest-plugin": "^4.0.1",
"@eslint/js": "^9.24.0",
"@microsoft/api-extractor": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// LICENSE file in the root directory of this source tree.
*/
scroll-view {
contain: content;
display: flex !important;
--lynx-display: linear !important;
--lynx-display-toggle: var(--lynx-display-linear);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class XAudioTT extends HTMLElement {
);

const response = await fetch(parsedSrc.play_url, {
mode: 'no-cors',
headers: parsedHeaders,
});

Expand Down
10 changes: 6 additions & 4 deletions packages/web-platform/web-explorer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '@lynx-js/web-elements/all';
import QrScanner from 'qr-scanner';

const video = document.getElementById('qr-scanner') as HTMLVideoElement;
const lynxView = document.getElementById('lynx-view') as LynxView;
let lynxView = document.getElementById('lynx-view') as LynxView;
const backButton = document.getElementById('back-button') as HTMLDivElement;
const nav = document.getElementById('nav') as HTMLDivElement;

Expand Down Expand Up @@ -63,12 +63,14 @@ lynxView.globalProps = { theme };
setLynxViewUrl(homepage);
window.addEventListener('message', (ev) => {
if (ev.data && ev.data.method === 'setLynxViewUrl' && ev.data.url) {
const parent = lynxView.parentElement!;
lynxView.remove();
lynxView = document.createElement('lynx-view') as LynxView;
lynxView.setAttribute('style', 'flex: 0 1 100vh; height:100vh;');
parent.append(lynxView);
setLynxViewUrl(ev.data.url);
}
});
setTimeout(() => {
window.parent?.postMessage('webExplorerReady');
}, 500);

function setLynxViewUrl(url: string) {
if (url === homepage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ export function createAttributeAndPropertyFunctions(
}
}

function __SetID(element: HTMLElement, id: string) {
element.id = id;
function __SetID(element: HTMLElement, id: string | null) {
if (typeof id === 'string') {
element.id = id;
} else {
element.removeAttribute('id');
}
}

function __UpdateComponentID(
Expand Down
33 changes: 33 additions & 0 deletions packages/web-platform/web-tests/tests/main-thread-apis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,39 @@ test.describe('main thread api tests', () => {
expect(page.locator('scroll-view')).toHaveAttribute('scroll-x', 'true');
},
);
test(
'__SetID',
async ({ page, browserName }, { title }) => {
const ret = await page.evaluate(() => {
let root = globalThis.__CreatePage('page', 0);
let ret = globalThis.__CreateView(0);
globalThis.__SetID(ret, 'target');
globalThis.__AppendElement(root, ret);
globalThis.__FlushElementTree();
});
expect(await page.locator('#target').count()).toBe(1);
},
);
test(
'__SetID to remove id',
async ({ page, browserName }, { title }) => {
const ret = await page.evaluate(() => {
let root = globalThis.__CreatePage('page', 0);
let ret = globalThis.__CreateView(0);
globalThis.__SetID(ret, 'target');
globalThis.__AppendElement(root, ret);
globalThis.__FlushElementTree();
globalThis.view = ret;
});
expect(await page.locator('#target').count()).toBe(1);
await page.evaluate(() => {
let ret = globalThis.view;
globalThis.__SetID(ret, null);
globalThis.__FlushElementTree();
});
expect(await page.locator('#target').count()).toBe(0);
},
);

test('__CreateText', async ({ page }, { title }) => {
const lynxTag = await page.evaluate(() => {
Expand Down
11 changes: 11 additions & 0 deletions packages/web-platform/web-tests/tests/react.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,17 @@ test.describe('reactlynx3 tests', () => {
});
});
test.describe('scroll-view', () => {
const elementName = 'scroll-view';
test('basic-element-scroll-view-fixed', async ({ page }, { title }) => {
await goto(page, title);
await diffScreenShot(
page,
elementName,
title,
'initial',
);
});

test(
'basic-element-scroll-view-scrollable',
async ({ page }, { title }) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,70 @@
import { root } from '@lynx-js/react';
export default function App() {
return (
<view
style={{
flexDirection: 'column',
background: 'skyblue',
height: '100vh',
}}
>
<scroll-view
scroll-y
className='w-screen bg-gray-100'
style={{ height: '600px' }}
>
<view
style={{
backgroundColor: 'skyblue',
width: '100%',
height: '1600px',
}}
>
<view
style={{ backgroundColor: 'red', width: '100%', height: '100px' }}
>
</view>
<view
style={{
backgroundColor: 'purple',
width: '100%',
height: '100px',
}}
>
</view>
<view
style={{
backgroundColor: 'orange',
width: '100%',
height: '100px',
}}
>
</view>
<view
style={{ backgroundColor: 'green', width: '100%', height: '100px' }}
>
</view>
<view
style={{ backgroundColor: 'blue', width: '100%', height: '100px' }}
>
</view>
<view
style={{
backgroundColor: 'yellow',
width: '100%',
height: '100px',
position: 'fixed',
bottom: '32px',
}}
>
</view>
</view>
</scroll-view>
</view>
);
}
root.render(
<page style={{ width: '100%' }}>
<App />
</page>,
);
Loading