From 2a3314d4a50480c3466571ec3330c9cc3715c1ce Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Fri, 12 Sep 2025 15:29:12 +0100 Subject: [PATCH 01/23] Open a shared Makecode project from the web --- src/App.tsx | 6 +++ src/hooks/project-hooks.tsx | 84 +++++++++++++++++++++++++++++++ src/messages/ui.en.json | 6 +++ src/model.ts | 11 ++++ src/pages/ImportSharedURLPage.tsx | 60 ++++++++++++++++++++++ src/store.ts | 19 +++++++ src/urls.ts | 2 + 7 files changed, 188 insertions(+) create mode 100644 src/pages/ImportSharedURLPage.tsx diff --git a/src/App.tsx b/src/App.tsx index 6b67b6589..1236efabc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -52,9 +52,11 @@ import { createDataSamplesPageUrl, createHomePageUrl, createImportPageUrl, + createImportSharedURLPageUrl, createNewPageUrl, createTestingModelPageUrl, } from "./urls"; +import { ImportSharedURLPage } from "./pages/ImportSharedURLPage"; export interface ProviderLayoutProps { children: ReactNode; @@ -179,6 +181,10 @@ const createRouter = () => { path: createCodePageUrl(), element: , }, + { + path: createImportSharedURLPageUrl(), + element: + }, { path: "*", element: , diff --git a/src/hooks/project-hooks.tsx b/src/hooks/project-hooks.tsx index f4c64da4f..36ddfad7e 100644 --- a/src/hooks/project-hooks.tsx +++ b/src/hooks/project-hooks.tsx @@ -27,6 +27,7 @@ import { isDatasetUserFileFormat, PostImportDialogState, SaveStep, + WebDownloadStep, } from "../model"; import { untitledProjectName as untitled } from "../project-name"; import { useStore } from "../store"; @@ -42,6 +43,7 @@ import { readFileAsText, } from "../utils/fs-util"; import { useDownloadActions } from "./download-hooks"; +import { Header, ScriptText } from "@microbit/makecode-embed/vanilla"; class CodeEditorError extends Error {} @@ -57,6 +59,7 @@ interface ProjectContext { projectEdited: boolean; resetProject: () => void; loadFile: (file: File, type: LoadType) => void; + importSharedURL: (url: string) => Promise; /** * Called to request a save. * @@ -354,6 +357,85 @@ export const ProjectProvider = ({ setPostImportDialogState, ] ); + const latestImportSharedURLPromise = useRef>(Promise.resolve()); + const importSharedURL = useCallback( + async (shortId: string): Promise => { + const appState = useStore.getState().sharedImportState; + + // Already downloading this project + if (appState.fetchKey === shortId && appState.step === WebDownloadStep.Active) return; + else if (appState.step !== WebDownloadStep.None) { + // downloading another project + useStore.getState().updateSharedImportState({step: WebDownloadStep.Cancelled}); + await latestImportSharedURLPromise.current; + } + logging.event({ + type: "import-shared-project", + detail: { shortId } + }); + useStore.getState().updateSharedImportState({ + step: WebDownloadStep.Active, + fetchKey: shortId + }); + const isCancelled = () => useStore.getState().sharedImportState.step === WebDownloadStep.Cancelled; + latestImportSharedURLPromise.current = (async () => { + if (isCancelled()) return; + + const headerResponse = await fetch(`https://www.makecode.com/api/${shortId}`); + const header = await headerResponse.json() as Header; + if (!header || !header.id) return Promise.reject("Incorrect header data"); + + if (isCancelled()) return; + + const textResponse = await fetch(`https://www.makecode.com/api/${header.id}/text`); + const text = await textResponse.json() as ScriptText; + + const hasTimedOut = await checkIfEditorStartUpTimedOut( + editorReadyPromise.promise + ); + + if (isCancelled()) return; + + if (hasTimedOut) { + openEditorTimedOutDialog(); + return; + } + + if (isCancelled()) return; + + // This triggers the code in editorChanged to update actions etc. + await driverRef.current!.importProject({project: {header, text}}); + })(); + + try { + await latestImportSharedURLPromise.current; + + logging.event({ + type: "import-shared-project-complete", + detail: { shortId } + }); + + } catch (e) { + + logging.event({ + type: "import-shared-project-failed", + detail: { shortId } + }); + + throw e; + } finally { + useStore.getState().updateSharedImportState(({ + step: WebDownloadStep.None, + fetchKey: undefined + })); + } + }, [ + checkIfEditorStartUpTimedOut, + driverRef, + editorReadyPromise.promise, + logging, + openEditorTimedOutDialog + ]); const setSave = useStore((s) => s.setSave); const save = useStore((s) => s.save); @@ -456,6 +538,7 @@ export const ProjectProvider = ({ const value = useMemo( () => ({ loadFile, + importSharedURL, openEditor, browserNavigationToEditor, project, @@ -474,6 +557,7 @@ export const ProjectProvider = ({ }), [ loadFile, + importSharedURL, openEditor, browserNavigationToEditor, project, diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index f6863544d..910fcd914 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -1959,6 +1959,12 @@ "value": "New session setup" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Importing a shared project" + } + ], "newpage-continue-session-subtitle": [ { "type": 0, diff --git a/src/model.ts b/src/model.ts index 3e05c4828..fc525d962 100644 --- a/src/model.ts +++ b/src/model.ts @@ -158,6 +158,17 @@ export enum SaveStep { SaveProgress = "progress", } +export enum WebDownloadStep { + None = "none", + Active = "active", + Cancelled = "cancelled" +} + +export interface SharedImportState { + step: WebDownloadStep; + fetchKey?: string; +} + export interface TourStep { selector?: string; title: ReactNode; diff --git a/src/pages/ImportSharedURLPage.tsx b/src/pages/ImportSharedURLPage.tsx new file mode 100644 index 000000000..2cbacc5d0 --- /dev/null +++ b/src/pages/ImportSharedURLPage.tsx @@ -0,0 +1,60 @@ +import { Heading, Stack, Text, VStack } from "@chakra-ui/react"; +import DefaultPageLayout, { HomeMenuItem, HomeToolbarItem } from "../components/DefaultPageLayout"; +import { FormattedMessage } from "react-intl"; +import { useParams } from "react-router"; +import NotFound from "../components/NotFound"; +import { useEffect, useState } from "react"; +import { useProject } from "../hooks/project-hooks"; + +export const ImportSharedURLPage = () => { + + const { shortId } = useParams(); + const { importSharedURL } = useProject(); + const [isLoadError, setLoadError] = useState(false); + + const idIsValid = !!shortId && /^_[a-zA-Z0-9]+$/.test(shortId); + + useEffect(() => { + if (!idIsValid) return; + importSharedURL(shortId) + .catch(e => { + console.error("Loading shared project failed", e); + setLoadError(true); + }); + }, [importSharedURL, idIsValid, shortId]); + + if (!idIsValid) { + return ; + } + + return ( + } + menuItems={} + > + + + + + + {isLoadError ?? Error loading project} + + + + ); +}; diff --git a/src/store.ts b/src/store.ts index f8a120af3..cf4171a8f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -35,6 +35,8 @@ import { EditorStartUp, TourTriggerName, tourSequence, + SharedImportState, + WebDownloadStep, } from "./model"; import { defaultSettings, Settings } from "./settings"; import { getTotalNumSamples } from "./utils/actions"; @@ -176,6 +178,8 @@ export interface State { downloadFlashingProgress: number; save: SaveState; + sharedImportState: SharedImportState; + settings: Settings; trainModelProgress: number; @@ -221,6 +225,7 @@ export interface Actions { loadDataset(actions: ActionData[]): void; loadProject(project: MakeCodeProject, name: string): void; + updateSharedImportState(update: Partial): void; setEditorOpen(open: boolean): void; recordingStarted(): void; recordingStopped(): void; @@ -311,6 +316,9 @@ const createMlStore = (logging: Logging) => { save: { step: SaveStep.None, }, + sharedImportState: { + step: WebDownloadStep.None + }, projectEdited: false, settings: defaultSettings, model: undefined, @@ -690,6 +698,17 @@ const createMlStore = (logging: Logging) => { }); }, + updateSharedImportState(update: Partial) { + set(({ sharedImportState }) => ({ + sharedImportState: { + ...sharedImportState, + ...update + } + }), + false, + "updateSharedImportState") + }, + closeTrainModelDialogs() { set({ trainModelDialogStage: TrainModelDialogStage.Closed, diff --git a/src/urls.ts b/src/urls.ts index af59616ea..24ba5c0cd 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -15,6 +15,8 @@ export const createNewPageUrl = () => `${basepath}new`; export const createImportPageUrl = () => `${basepath}import`; +export const createImportSharedURLPageUrl = () => `${basepath}:shortId`; + export const createDataSamplesPageUrl = () => `${basepath}data-samples`; export const createTestingModelPageUrl = () => `${basepath}testing-model`; From 461fa5fce404337c8d6c1125fc17a18d8fc005cc Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Fri, 12 Sep 2025 15:38:04 +0100 Subject: [PATCH 02/23] Prettifier fixes --- src/App.tsx | 2 +- src/hooks/project-hooks.tsx | 61 +++++++++++++++++++------------ src/model.ts | 2 +- src/pages/ImportSharedURLPage.tsx | 39 ++++++++++---------- src/store.ts | 18 +++++---- 5 files changed, 69 insertions(+), 53 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1236efabc..35013f9df 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -183,7 +183,7 @@ const createRouter = () => { }, { path: createImportSharedURLPageUrl(), - element: + element: , }, { path: "*", diff --git a/src/hooks/project-hooks.tsx b/src/hooks/project-hooks.tsx index 36ddfad7e..a3a1df6d5 100644 --- a/src/hooks/project-hooks.tsx +++ b/src/hooks/project-hooks.tsx @@ -363,32 +363,45 @@ export const ProjectProvider = ({ const appState = useStore.getState().sharedImportState; // Already downloading this project - if (appState.fetchKey === shortId && appState.step === WebDownloadStep.Active) return; + if ( + appState.fetchKey === shortId && + appState.step === WebDownloadStep.Active + ) + return; else if (appState.step !== WebDownloadStep.None) { // downloading another project - useStore.getState().updateSharedImportState({step: WebDownloadStep.Cancelled}); + useStore + .getState() + .updateSharedImportState({ step: WebDownloadStep.Cancelled }); await latestImportSharedURLPromise.current; } logging.event({ type: "import-shared-project", - detail: { shortId } + detail: { shortId }, }); useStore.getState().updateSharedImportState({ step: WebDownloadStep.Active, - fetchKey: shortId + fetchKey: shortId, }); - const isCancelled = () => useStore.getState().sharedImportState.step === WebDownloadStep.Cancelled; + const isCancelled = () => + useStore.getState().sharedImportState.step === + WebDownloadStep.Cancelled; latestImportSharedURLPromise.current = (async () => { if (isCancelled()) return; - const headerResponse = await fetch(`https://www.makecode.com/api/${shortId}`); - const header = await headerResponse.json() as Header; - if (!header || !header.id) return Promise.reject("Incorrect header data"); + const headerResponse = await fetch( + `https://www.makecode.com/api/${shortId}` + ); + const header = (await headerResponse.json()) as Header; + if (!header || !header.id) + return Promise.reject("Incorrect header data"); if (isCancelled()) return; - const textResponse = await fetch(`https://www.makecode.com/api/${header.id}/text`); - const text = await textResponse.json() as ScriptText; + const textResponse = await fetch( + `https://www.makecode.com/api/${header.id}/text` + ); + const text = (await textResponse.json()) as ScriptText; const hasTimedOut = await checkIfEditorStartUpTimedOut( editorReadyPromise.promise @@ -404,38 +417,38 @@ export const ProjectProvider = ({ if (isCancelled()) return; // This triggers the code in editorChanged to update actions etc. - await driverRef.current!.importProject({project: {header, text}}); + await driverRef.current!.importProject({ project: { header, text } }); })(); try { await latestImportSharedURLPromise.current; - logging.event({ - type: "import-shared-project-complete", - detail: { shortId } - }); - + logging.event({ + type: "import-shared-project-complete", + detail: { shortId }, + }); } catch (e) { - logging.event({ type: "import-shared-project-failed", - detail: { shortId } + detail: { shortId }, }); throw e; } finally { - useStore.getState().updateSharedImportState(({ + useStore.getState().updateSharedImportState({ step: WebDownloadStep.None, - fetchKey: undefined - })); + fetchKey: undefined, + }); } - }, [ + }, + [ checkIfEditorStartUpTimedOut, driverRef, editorReadyPromise.promise, logging, - openEditorTimedOutDialog - ]); + openEditorTimedOutDialog, + ] + ); const setSave = useStore((s) => s.setSave); const save = useStore((s) => s.save); diff --git a/src/model.ts b/src/model.ts index fc525d962..82b976769 100644 --- a/src/model.ts +++ b/src/model.ts @@ -161,7 +161,7 @@ export enum SaveStep { export enum WebDownloadStep { None = "none", Active = "active", - Cancelled = "cancelled" + Cancelled = "cancelled", } export interface SharedImportState { diff --git a/src/pages/ImportSharedURLPage.tsx b/src/pages/ImportSharedURLPage.tsx index 2cbacc5d0..3a0c8aaeb 100644 --- a/src/pages/ImportSharedURLPage.tsx +++ b/src/pages/ImportSharedURLPage.tsx @@ -1,33 +1,34 @@ import { Heading, Stack, Text, VStack } from "@chakra-ui/react"; -import DefaultPageLayout, { HomeMenuItem, HomeToolbarItem } from "../components/DefaultPageLayout"; +import DefaultPageLayout, { + HomeMenuItem, + HomeToolbarItem, +} from "../components/DefaultPageLayout"; import { FormattedMessage } from "react-intl"; -import { useParams } from "react-router"; +import { useParams } from "react-router"; import NotFound from "../components/NotFound"; import { useEffect, useState } from "react"; import { useProject } from "../hooks/project-hooks"; export const ImportSharedURLPage = () => { + const { shortId } = useParams(); + const { importSharedURL } = useProject(); + const [isLoadError, setLoadError] = useState(false); - const { shortId } = useParams(); - const { importSharedURL } = useProject(); - const [isLoadError, setLoadError] = useState(false); + const idIsValid = !!shortId && /^_[a-zA-Z0-9]+$/.test(shortId); - const idIsValid = !!shortId && /^_[a-zA-Z0-9]+$/.test(shortId); + useEffect(() => { + if (!idIsValid) return; + importSharedURL(shortId).catch((e) => { + console.error("Loading shared project failed", e); + setLoadError(true); + }); + }, [importSharedURL, idIsValid, shortId]); - useEffect(() => { - if (!idIsValid) return; - importSharedURL(shortId) - .catch(e => { - console.error("Loading shared project failed", e); - setLoadError(true); - }); - }, [importSharedURL, idIsValid, shortId]); + if (!idIsValid) { + return ; + } - if (!idIsValid) { - return ; - } - - return ( + return ( } diff --git a/src/store.ts b/src/store.ts index cf4171a8f..c6e124b71 100644 --- a/src/store.ts +++ b/src/store.ts @@ -317,7 +317,7 @@ const createMlStore = (logging: Logging) => { step: SaveStep.None, }, sharedImportState: { - step: WebDownloadStep.None + step: WebDownloadStep.None, }, projectEdited: false, settings: defaultSettings, @@ -699,14 +699,16 @@ const createMlStore = (logging: Logging) => { }, updateSharedImportState(update: Partial) { - set(({ sharedImportState }) => ({ - sharedImportState: { - ...sharedImportState, - ...update - } - }), + set( + ({ sharedImportState }) => ({ + sharedImportState: { + ...sharedImportState, + ...update, + }, + }), false, - "updateSharedImportState") + "updateSharedImportState" + ); }, closeTrainModelDialogs() { From 1ac93e3bca33130f78e8282860555e86e628cb1a Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Thu, 18 Sep 2025 16:46:22 +0100 Subject: [PATCH 03/23] Refactored to new two-step import for shared projects --- lang/ui.ca.json | 8 ++ lang/ui.en.json | 8 ++ lang/ui.es-es.json | 8 ++ lang/ui.ja.json | 8 ++ lang/ui.ko.json | 8 ++ lang/ui.lol.json | 8 ++ lang/ui.nl.json | 8 ++ lang/ui.pl.json | 8 ++ lang/ui.pt-br.json | 8 ++ lang/ui.zh-tw.json | 8 ++ src/App.tsx | 7 + src/hooks/project-hooks.tsx | 97 ------------- src/messages/ui.ca.json | 12 ++ src/messages/ui.en.json | 18 ++- src/messages/ui.es-es.json | 12 ++ src/messages/ui.ja.json | 12 ++ src/messages/ui.ko.json | 12 ++ src/messages/ui.lol.json | 12 ++ src/messages/ui.nl.json | 12 ++ src/messages/ui.pl.json | 12 ++ src/messages/ui.pt-br.json | 12 ++ src/messages/ui.zh-tw.json | 12 ++ src/model.ts | 11 -- src/pages/ImportSharedURLPage.tsx | 227 +++++++++++++++++++++++++++--- src/store.ts | 21 --- 25 files changed, 417 insertions(+), 152 deletions(-) diff --git a/lang/ui.ca.json b/lang/ui.ca.json index 8a2bc1912..d2b3aac1b 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -839,6 +839,10 @@ "defaultMessage": "Tipus d'arxiu no permés", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Torna enrere per seleccionar una micro:bit diferent, o bé desa l'hexadecimal del projecte que es pot transferir a una micro:bit V2 més tard.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Prova el model", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Tour", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.en.json b/lang/ui.en.json index 15df376e5..a89751474 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -839,6 +839,10 @@ "defaultMessage": "Unsupported file type", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Go back to select a different micro:bit, or save the project hex which can be downloaded onto a micro:bit V2 later.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Testing model", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Tour", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index c524073d4..19f488893 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -839,6 +839,10 @@ "defaultMessage": "Tipo de archivo no compatible", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Vuelve atrás para seleccionar un micro:bit diferente o guarda el hexadecimal del proyecto para poder descargarlo más tarde en un micro:bit V2.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Modelo de pruebas", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Recorrido", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 5d7ad2166..1d4d2a832 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -839,6 +839,10 @@ "defaultMessage": "対応していないファイル形式です", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "戻って別のmicro:bitを選ぶか、プロジェクトのhexを保存して、micro:bit V2にダウンロードしてください。", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "モデルのテスト", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "ツアー", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index 42dc0ffe5..2c00079b6 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -839,6 +839,10 @@ "defaultMessage": "지원되지 않는 파일 유형", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "뒤로 돌아가 다른 micro:bit를 선택하거나, 프로젝트 hex를 저장하세요. 프로젝트 hex는 나중에 micro:bit V2에 다운로드할 수 있습니다.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "모델 테스트 중", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "투어", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.lol.json b/lang/ui.lol.json index 414cd058b..e5fffaeef 100644 --- a/lang/ui.lol.json +++ b/lang/ui.lol.json @@ -839,6 +839,10 @@ "defaultMessage": "crwdns363048:0crwdne363048:0", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "crwdns363050:0crwdne363050:0", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "crwdns363368:0crwdne363368:0", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "crwdns363370:0crwdne363370:0", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 92c7c28e6..45e87e627 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -839,6 +839,10 @@ "defaultMessage": "Niet-ondersteund bestandstype", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Ga terug naar een andere micro:bit, of sla de project-hex op die later kan worden gedownload naar een micro:bit V2", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Model testen", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Rondleiding", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.pl.json b/lang/ui.pl.json index 23159e28c..64d02b30d 100644 --- a/lang/ui.pl.json +++ b/lang/ui.pl.json @@ -839,6 +839,10 @@ "defaultMessage": "Nieobsługiwany typ pliku", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Wróć, aby wybrać inny micro:bit lub zapisz hex projektu, który można pobrać na micro:bit V2 później.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Model testowy", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Trasa", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.pt-br.json b/lang/ui.pt-br.json index 7381c6fb0..5c12fe8d4 100644 --- a/lang/ui.pt-br.json +++ b/lang/ui.pt-br.json @@ -839,6 +839,10 @@ "defaultMessage": "Tipo de arquivo não suportado.", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "Volte para selecionar um micro:bit diferente, ou salve o arquivo hex do projeto, que pode ser baixado em um micro:bit V2 mais tarde.", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "Modelo de teste", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "Fazer um tour", "description": "Button label that starts a tour of the app's features" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index 94e2db06f..bc048492d 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -839,6 +839,10 @@ "defaultMessage": "不支援的檔案類型", "description": "Title of import error dialog" }, + "import-shared-url-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "incompatible-device-body-alt": { "defaultMessage": "返回選擇不同的 micro:bit,或儲存專案十六進位檔案,稍後可以將其下載到 micro:bit V2 上。", "description": "Incompatible device dialog body text" @@ -1499,6 +1503,10 @@ "defaultMessage": "測試模型", "description": "Testing model page title" }, + "third-party-content-description": { + "defaultMessage": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation.", + "description": "Notify user of third party content" + }, "tour-action": { "defaultMessage": "導覽", "description": "Button label that starts a tour of the app's features" diff --git a/src/App.tsx b/src/App.tsx index 35013f9df..ad0621d9e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -183,7 +183,14 @@ const createRouter = () => { }, { path: createImportSharedURLPageUrl(), + loader: ({ params }) => { + if (!params.shortId || !/^_[a-zA-Z0-9]+$/.test(params.shortId)) { + throw "Not a shared key"; + } + return null; + }, element: , + errorElement: , }, { path: "*", diff --git a/src/hooks/project-hooks.tsx b/src/hooks/project-hooks.tsx index a3a1df6d5..f4c64da4f 100644 --- a/src/hooks/project-hooks.tsx +++ b/src/hooks/project-hooks.tsx @@ -27,7 +27,6 @@ import { isDatasetUserFileFormat, PostImportDialogState, SaveStep, - WebDownloadStep, } from "../model"; import { untitledProjectName as untitled } from "../project-name"; import { useStore } from "../store"; @@ -43,7 +42,6 @@ import { readFileAsText, } from "../utils/fs-util"; import { useDownloadActions } from "./download-hooks"; -import { Header, ScriptText } from "@microbit/makecode-embed/vanilla"; class CodeEditorError extends Error {} @@ -59,7 +57,6 @@ interface ProjectContext { projectEdited: boolean; resetProject: () => void; loadFile: (file: File, type: LoadType) => void; - importSharedURL: (url: string) => Promise; /** * Called to request a save. * @@ -357,98 +354,6 @@ export const ProjectProvider = ({ setPostImportDialogState, ] ); - const latestImportSharedURLPromise = useRef>(Promise.resolve()); - const importSharedURL = useCallback( - async (shortId: string): Promise => { - const appState = useStore.getState().sharedImportState; - - // Already downloading this project - if ( - appState.fetchKey === shortId && - appState.step === WebDownloadStep.Active - ) - return; - else if (appState.step !== WebDownloadStep.None) { - // downloading another project - useStore - .getState() - .updateSharedImportState({ step: WebDownloadStep.Cancelled }); - await latestImportSharedURLPromise.current; - } - logging.event({ - type: "import-shared-project", - detail: { shortId }, - }); - useStore.getState().updateSharedImportState({ - step: WebDownloadStep.Active, - fetchKey: shortId, - }); - const isCancelled = () => - useStore.getState().sharedImportState.step === - WebDownloadStep.Cancelled; - latestImportSharedURLPromise.current = (async () => { - if (isCancelled()) return; - - const headerResponse = await fetch( - `https://www.makecode.com/api/${shortId}` - ); - const header = (await headerResponse.json()) as Header; - if (!header || !header.id) - return Promise.reject("Incorrect header data"); - - if (isCancelled()) return; - - const textResponse = await fetch( - `https://www.makecode.com/api/${header.id}/text` - ); - const text = (await textResponse.json()) as ScriptText; - - const hasTimedOut = await checkIfEditorStartUpTimedOut( - editorReadyPromise.promise - ); - - if (isCancelled()) return; - - if (hasTimedOut) { - openEditorTimedOutDialog(); - return; - } - - if (isCancelled()) return; - - // This triggers the code in editorChanged to update actions etc. - await driverRef.current!.importProject({ project: { header, text } }); - })(); - - try { - await latestImportSharedURLPromise.current; - - logging.event({ - type: "import-shared-project-complete", - detail: { shortId }, - }); - } catch (e) { - logging.event({ - type: "import-shared-project-failed", - detail: { shortId }, - }); - - throw e; - } finally { - useStore.getState().updateSharedImportState({ - step: WebDownloadStep.None, - fetchKey: undefined, - }); - } - }, - [ - checkIfEditorStartUpTimedOut, - driverRef, - editorReadyPromise.promise, - logging, - openEditorTimedOutDialog, - ] - ); const setSave = useStore((s) => s.setSave); const save = useStore((s) => s.save); @@ -551,7 +456,6 @@ export const ProjectProvider = ({ const value = useMemo( () => ({ loadFile, - importSharedURL, openEditor, browserNavigationToEditor, project, @@ -570,7 +474,6 @@ export const ProjectProvider = ({ }), [ loadFile, - importSharedURL, openEditor, browserNavigationToEditor, project, diff --git a/src/messages/ui.ca.json b/src/messages/ui.ca.json index 5fb19407d..650111250 100644 --- a/src/messages/ui.ca.json +++ b/src/messages/ui.ca.json @@ -1433,6 +1433,12 @@ "value": "Tipus d'arxiu no permés" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2629,6 +2635,12 @@ "value": "Prova el model" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index 910fcd914..490701084 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -1447,6 +1447,12 @@ "value": "Unsupported file type" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -1959,12 +1965,6 @@ "value": "New session setup" } ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Importing a shared project" - } - ], "newpage-continue-session-subtitle": [ { "type": 0, @@ -2649,6 +2649,12 @@ "value": "Testing model" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.es-es.json b/src/messages/ui.es-es.json index 9c05019d2..91f8f2360 100644 --- a/src/messages/ui.es-es.json +++ b/src/messages/ui.es-es.json @@ -1447,6 +1447,12 @@ "value": "Tipo de archivo no compatible" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2643,6 +2649,12 @@ "value": "Modelo de pruebas" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.ja.json b/src/messages/ui.ja.json index 77c3a43d1..4a1a71984 100644 --- a/src/messages/ui.ja.json +++ b/src/messages/ui.ja.json @@ -1427,6 +1427,12 @@ "value": "対応していないファイル形式です" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2607,6 +2613,12 @@ "value": "モデルのテスト" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.ko.json b/src/messages/ui.ko.json index f9c9dd71d..40619dad5 100644 --- a/src/messages/ui.ko.json +++ b/src/messages/ui.ko.json @@ -1435,6 +1435,12 @@ "value": "지원되지 않는 파일 유형" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2623,6 +2629,12 @@ "value": "모델 테스트 중" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.lol.json b/src/messages/ui.lol.json index 9e77afd9b..749a401f6 100644 --- a/src/messages/ui.lol.json +++ b/src/messages/ui.lol.json @@ -1379,6 +1379,12 @@ "value": "crwdns363048:0crwdne363048:0" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2505,6 +2511,12 @@ "value": "crwdns363368:0crwdne363368:0" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.nl.json b/src/messages/ui.nl.json index 5c78a00c2..0954b138e 100644 --- a/src/messages/ui.nl.json +++ b/src/messages/ui.nl.json @@ -1447,6 +1447,12 @@ "value": "Niet-ondersteund bestandstype" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2643,6 +2649,12 @@ "value": "Model testen" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.pl.json b/src/messages/ui.pl.json index bc135e5fb..9deec9a77 100644 --- a/src/messages/ui.pl.json +++ b/src/messages/ui.pl.json @@ -1451,6 +1451,12 @@ "value": "Nieobsługiwany typ pliku" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2639,6 +2645,12 @@ "value": "Model testowy" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.pt-br.json b/src/messages/ui.pt-br.json index 056015f3d..d323c3851 100644 --- a/src/messages/ui.pt-br.json +++ b/src/messages/ui.pt-br.json @@ -1447,6 +1447,12 @@ "value": "Tipo de arquivo não suportado." } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2623,6 +2629,12 @@ "value": "Modelo de teste" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/messages/ui.zh-tw.json b/src/messages/ui.zh-tw.json index 4f8a95c00..271136d3f 100644 --- a/src/messages/ui.zh-tw.json +++ b/src/messages/ui.zh-tw.json @@ -1443,6 +1443,12 @@ "value": "不支援的檔案類型" } ], + "import-shared-url-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "incompatible-device-body-alt": [ { "type": 0, @@ -2635,6 +2641,12 @@ "value": "測試模型" } ], + "third-party-content-description": [ + { + "type": 0, + "value": "The content above is provided by a third party, and is not endorsed by the Micro:bit Educational Foundation." + } + ], "tour-action": [ { "type": 0, diff --git a/src/model.ts b/src/model.ts index 82b976769..3e05c4828 100644 --- a/src/model.ts +++ b/src/model.ts @@ -158,17 +158,6 @@ export enum SaveStep { SaveProgress = "progress", } -export enum WebDownloadStep { - None = "none", - Active = "active", - Cancelled = "cancelled", -} - -export interface SharedImportState { - step: WebDownloadStep; - fetchKey?: string; -} - export interface TourStep { selector?: string; title: ReactNode; diff --git a/src/pages/ImportSharedURLPage.tsx b/src/pages/ImportSharedURLPage.tsx index 3a0c8aaeb..e4c48f13e 100644 --- a/src/pages/ImportSharedURLPage.tsx +++ b/src/pages/ImportSharedURLPage.tsx @@ -1,32 +1,98 @@ -import { Heading, Stack, Text, VStack } from "@chakra-ui/react"; +import { + Button, + Heading, + HStack, + Input, + Stack, + Text, + VStack, +} from "@chakra-ui/react"; import DefaultPageLayout, { HomeMenuItem, HomeToolbarItem, } from "../components/DefaultPageLayout"; -import { FormattedMessage } from "react-intl"; -import { useParams } from "react-router"; -import NotFound from "../components/NotFound"; -import { useEffect, useState } from "react"; +import { FormattedMessage, useIntl } from "react-intl"; +import { useNavigate, useParams } from "react-router"; +import { ReactNode, useCallback, useEffect, useState } from "react"; +import { useLogging } from "../logging/logging-hooks"; +import { useStore } from "../store"; +import { ButtonWithLoading } from "../components/ButtonWithLoading"; +import LoadingAnimation from "../components/LoadingAnimation"; +import { Header, ScriptText } from "@microbit/makecode-embed/vanilla"; +import { createDataSamplesPageUrl } from "../urls"; import { useProject } from "../hooks/project-hooks"; +const enum SharedState { + None = 0, + GettingHeader = 1, + GettingProject = 2, + Complete = 3, + Failed = 4, +} + export const ImportSharedURLPage = () => { const { shortId } = useParams(); - const { importSharedURL } = useProject(); - const [isLoadError, setLoadError] = useState(false); + const log = useLogging(); + + const navigate = useNavigate(); + const [sharedState, setSharedState] = useState(SharedState.None); + + const [header, setHeader] = useState
(); + const [projectText, setProjectText] = useState(); - const idIsValid = !!shortId && /^_[a-zA-Z0-9]+$/.test(shortId); + const [name, setName] = useState("Not Loaded"); + const loadProject = useStore((s) => s.loadProject); + + const handleStartSession = useCallback(() => { + if (!header || !projectText) return; + loadProject({ header: { ...header, name }, text: projectText }, name); + navigate(createDataSamplesPageUrl(), { replace: true }); + }, [loadProject, header, projectText, name, navigate]); useEffect(() => { - if (!idIsValid) return; - importSharedURL(shortId).catch((e) => { - console.error("Loading shared project failed", e); - setLoadError(true); + if (!shortId) return; + setSharedState(SharedState.GettingHeader); + log.event({ + type: "import-shared-project", + detail: { shortId }, }); - }, [importSharedURL, idIsValid, shortId]); + fetchSharedHeader(shortId) + .then((header) => { + setSharedState(SharedState.GettingProject); + setHeader(header); + setName(header.name); + log.event({ + type: "import-shared-project", + detail: { shortId }, + }); + return fetchSharedProjectText(header.id); + }) + .then((text) => { + setSharedState(SharedState.Complete); + setProjectText(text); + }) + .catch((e) => { + log.error("Did not load shared project for import"); + log.error(e); + setSharedState(SharedState.Failed); + }); + }, [log, shortId]); - if (!idIsValid) { - return ; - } + if (sharedState < SharedState.GettingProject) + return ( + } + menuItems={} + > + + + + + + + + ); return ( { - {isLoadError ?? Error loading project} + {sharedState === SharedState.Failed && ( + Error loading project + )} + {sharedState === SharedState.GettingHeader && } + {sharedState >= SharedState.GettingProject && ( + + )} ); }; + +interface ProjectLoadDetailsProps { + name: string; + setName: (name: string) => void; + sharedState: SharedState; + handleStartSession: () => void; +} +const ProjectLoadDetails = ({ + name, + setName, + sharedState, + handleStartSession, +}: ProjectLoadDetailsProps) => { + const intl = useIntl(); + const timestamp = useStore((s) => s.timestamp); + const nameLabel = intl.formatMessage({ id: "name-text" }); + const { saveHex } = useProject(); + const handleSave = useCallback(() => { + void saveHex(); + }, [saveHex]); + + return ( + <> + {timestamp !== undefined && ( + + ( + + ), + }} + /> + + )} + + + + + setName(e.currentTarget.value)} + /> + + ( + + ), + }} + /> + + + + + + + + + ); +}; + +const fetchSharedHeader = async (shortId: string): Promise
=> { + const headerResponse = await fetch(`https://www.makecode.com/api/${shortId}`); + if (headerResponse.status !== 200) { + throw "Network errorr"; + } + const header = (await headerResponse.json()) as Header; + if (!header || !header.id || !header.name) { + return Promise.reject("Incorrect header data"); + } + return header; +}; + +const fetchSharedProjectText = async (longId: string): Promise => { + const textResponse = await fetch( + `https://www.makecode.com/api/${longId}/text` + ); + if (textResponse.status !== 200) { + throw "Network errorr"; + } + const text = (await textResponse.json()) as ScriptText; + if (typeof text !== "object") { + throw "Error downloding project"; + } + return text; +}; diff --git a/src/store.ts b/src/store.ts index c6e124b71..f8a120af3 100644 --- a/src/store.ts +++ b/src/store.ts @@ -35,8 +35,6 @@ import { EditorStartUp, TourTriggerName, tourSequence, - SharedImportState, - WebDownloadStep, } from "./model"; import { defaultSettings, Settings } from "./settings"; import { getTotalNumSamples } from "./utils/actions"; @@ -178,8 +176,6 @@ export interface State { downloadFlashingProgress: number; save: SaveState; - sharedImportState: SharedImportState; - settings: Settings; trainModelProgress: number; @@ -225,7 +221,6 @@ export interface Actions { loadDataset(actions: ActionData[]): void; loadProject(project: MakeCodeProject, name: string): void; - updateSharedImportState(update: Partial): void; setEditorOpen(open: boolean): void; recordingStarted(): void; recordingStopped(): void; @@ -316,9 +311,6 @@ const createMlStore = (logging: Logging) => { save: { step: SaveStep.None, }, - sharedImportState: { - step: WebDownloadStep.None, - }, projectEdited: false, settings: defaultSettings, model: undefined, @@ -698,19 +690,6 @@ const createMlStore = (logging: Logging) => { }); }, - updateSharedImportState(update: Partial) { - set( - ({ sharedImportState }) => ({ - sharedImportState: { - ...sharedImportState, - ...update, - }, - }), - false, - "updateSharedImportState" - ); - }, - closeTrainModelDialogs() { set({ trainModelDialogStage: TrainModelDialogStage.Closed, From dcca96830ddd76f237ecf9fe367dee2974167588 Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Tue, 23 Sep 2025 15:34:01 +0100 Subject: [PATCH 04/23] Previews in shared project import --- lang/ui.ca.json | 28 ++ lang/ui.en.json | 28 ++ lang/ui.es-es.json | 28 ++ lang/ui.ja.json | 28 ++ lang/ui.ko.json | 28 ++ lang/ui.lol.json | 28 ++ lang/ui.nl.json | 28 ++ lang/ui.pl.json | 28 ++ lang/ui.pt-br.json | 28 ++ lang/ui.zh-tw.json | 28 ++ src/components/ActionDataSamplesCard.tsx | 48 ++- src/components/ActionNameCard.tsx | 1 + src/components/DataSamplesTableHints.tsx | 2 +- src/components/DataSamplesTableRow.tsx | 17 +- src/messages/ui.ca.json | 42 +++ src/messages/ui.en.json | 42 +++ src/messages/ui.es-es.json | 42 +++ src/messages/ui.ja.json | 42 +++ src/messages/ui.ko.json | 42 +++ src/messages/ui.lol.json | 42 +++ src/messages/ui.nl.json | 42 +++ src/messages/ui.pl.json | 42 +++ src/messages/ui.pt-br.json | 42 +++ src/messages/ui.zh-tw.json | 42 +++ src/pages/ImportSharedURLPage.tsx | 429 +++++++++++++++++------ 25 files changed, 1060 insertions(+), 137 deletions(-) diff --git a/lang/ui.ca.json b/lang/ui.ca.json index d2b3aac1b..0a1c35fce 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -839,6 +839,34 @@ "defaultMessage": "Tipus d'arxiu no permés", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.en.json b/lang/ui.en.json index a89751474..913b6f51a 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -839,6 +839,34 @@ "defaultMessage": "Unsupported file type", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index 19f488893..ae6bab169 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -839,6 +839,34 @@ "defaultMessage": "Tipo de archivo no compatible", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 1d4d2a832..5a806170c 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -839,6 +839,34 @@ "defaultMessage": "対応していないファイル形式です", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index 2c00079b6..ba6c8f6e4 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -839,6 +839,34 @@ "defaultMessage": "지원되지 않는 파일 유형", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.lol.json b/lang/ui.lol.json index e5fffaeef..fb8119e37 100644 --- a/lang/ui.lol.json +++ b/lang/ui.lol.json @@ -839,6 +839,34 @@ "defaultMessage": "crwdns363048:0crwdne363048:0", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 45e87e627..159e2fc5b 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -839,6 +839,34 @@ "defaultMessage": "Niet-ondersteund bestandstype", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.pl.json b/lang/ui.pl.json index 64d02b30d..f3884f09a 100644 --- a/lang/ui.pl.json +++ b/lang/ui.pl.json @@ -839,6 +839,34 @@ "defaultMessage": "Nieobsługiwany typ pliku", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.pt-br.json b/lang/ui.pt-br.json index 5c12fe8d4..3254f1a06 100644 --- a/lang/ui.pt-br.json +++ b/lang/ui.pt-br.json @@ -839,6 +839,34 @@ "defaultMessage": "Tipo de arquivo não suportado.", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index bc048492d..7f83a482e 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -839,6 +839,34 @@ "defaultMessage": "不支援的檔案類型", "description": "Title of import error dialog" }, + "import-shared-url-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "import-shared-url-blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, + "import-shared-url-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "import-shared-url-data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, + "import-shared-url-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "import-shared-url-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "import-shared-url-error-title": { + "defaultMessage": "An error occurred while fetching the shared project", + "description": "Import shared CreateAI error page title" + }, "import-shared-url-title": { "defaultMessage": "Open shared CreateAI project", "description": "Import shared CreateAI project title" diff --git a/src/components/ActionDataSamplesCard.tsx b/src/components/ActionDataSamplesCard.tsx index cfd38823b..a9322198a 100644 --- a/src/components/ActionDataSamplesCard.tsx +++ b/src/components/ActionDataSamplesCard.tsx @@ -10,6 +10,7 @@ import { ButtonGroup, Card, CardBody, + CardProps, CloseButton, HStack, Icon, @@ -40,10 +41,11 @@ const flash = keyframes({ }); interface ActionDataSamplesCardProps { + readonly?: boolean; value: ActionData; selected: boolean; onSelectRow?: () => void; - onRecord: (recordingOptions: RecordingOptions) => void; + onRecord?: (recordingOptions: RecordingOptions) => void; newRecordingId?: number; clearNewRecordingId?: () => void; } @@ -55,6 +57,7 @@ const ActionDataSamplesCard = ({ onRecord, newRecordingId, clearNewRecordingId, + readonly, }: ActionDataSamplesCardProps) => { const intl = useIntl(); const deleteActionRecording = useStore((s) => s.deleteActionRecording); @@ -63,23 +66,26 @@ const ActionDataSamplesCard = ({ // We split the cards in this case return ( - - - + position="relative" + className={tourElClassname.recordDataSamplesCard} + > + + + )} {value.recordings.map((recording, idx) => ( - + {!!onRecord && ( + + )} {value.recordings.map((recording, idx) => ( void; children: ReactNode; diff --git a/src/components/ActionNameCard.tsx b/src/components/ActionNameCard.tsx index 9ae570e37..e1c1eebb1 100644 --- a/src/components/ActionNameCard.tsx +++ b/src/components/ActionNameCard.tsx @@ -110,6 +110,7 @@ const ActionNameCard = ({ position="relative" className={tourElClassname.dataSamplesActionCard} opacity={disabled ? 0.5 : undefined} + variant={readOnly ? "outline" : undefined} > {!readOnly && onDeleteAction && ( void; + onRecord?: (recordingOptions: RecordingOptions) => void; } const DataSamplesTableHints = ({ diff --git a/src/components/DataSamplesTableRow.tsx b/src/components/DataSamplesTableRow.tsx index 654002b86..fdbd94dd0 100644 --- a/src/components/DataSamplesTableRow.tsx +++ b/src/components/DataSamplesTableRow.tsx @@ -14,15 +14,16 @@ import { RecordingOptions } from "./RecordingDialog"; import { RefType } from "react-hotkeys-hook/dist/types"; interface DataSamplesTableRowProps { + readonly?: boolean; action: ActionData; selected: boolean; - onSelectRow: () => void; - onRecord: (recordingOptions: RecordingOptions) => void; + onSelectRow?: () => void; + onRecord?: (recordingOptions: RecordingOptions) => void; showHints: boolean; newRecordingId?: number; - clearNewRecordingId: () => void; - onDeleteAction: () => void; - renameShortcutScopeRef: (instance: RefType) => void; + clearNewRecordingId?: () => void; + onDeleteAction?: () => void; + renameShortcutScopeRef?: (instance: RefType) => void; } const DataSamplesTableRow = ({ @@ -30,7 +31,8 @@ const DataSamplesTableRow = ({ selected, onSelectRow, onRecord, - showHints: showHints, + readonly, + showHints, newRecordingId, clearNewRecordingId, onDeleteAction, @@ -58,7 +60,7 @@ const DataSamplesTableRow = ({ onDeleteAction={onDeleteAction} onSelectRow={onSelectRow} selected={selected} - readOnly={false} + readOnly={!!readonly} /> {showHints ? ( @@ -67,6 +69,7 @@ const DataSamplesTableRow = ({ {(action.name.length > 0 || action.recordings.length > 0) && ( { - const { shortId } = useParams(); - const log = useLogging(); - - const navigate = useNavigate(); - const [sharedState, setSharedState] = useState(SharedState.None); +const contentStackProps: Partial = { + bgColor: "white", + spacing: 5, + m: [20], + borderRadius: [0, "20px"], + borderWidth: [null, 1], + borderBottomWidth: 1, + borderColor: [null, "gray.300"], + py: [5, 8], + px: [3, 5, 8], + minW: [null, null, "xl"], + alignItems: "stretch", + width: ["100%", "90%", "80%"], +}; - const [header, setHeader] = useState
(); - const [projectText, setProjectText] = useState(); +const readableProps: Partial = { + width: "65ch", +}; +export const ImportSharedURLPage = () => { const [name, setName] = useState("Not Loaded"); + const logging = useLogging(); + const navigate = useNavigate(); const loadProject = useStore((s) => s.loadProject); + const { sharedState, header, dataset, projectText } = + useProjectPreload(setName); + const { shortId } = useParams(); - const handleStartSession = useCallback(() => { + const onStartSession = useCallback(() => { if (!header || !projectText) return; loadProject({ header: { ...header, name }, text: projectText }, name); - navigate(createDataSamplesPageUrl(), { replace: true }); - }, [loadProject, header, projectText, name, navigate]); - - useEffect(() => { - if (!shortId) return; - setSharedState(SharedState.GettingHeader); - log.event({ - type: "import-shared-project", + logging.event({ + type: "import-shared-project-complete", detail: { shortId }, }); - fetchSharedHeader(shortId) - .then((header) => { - setSharedState(SharedState.GettingProject); - setHeader(header); - setName(header.name); - log.event({ - type: "import-shared-project", - detail: { shortId }, - }); - return fetchSharedProjectText(header.id); - }) - .then((text) => { - setSharedState(SharedState.Complete); - setProjectText(text); - }) - .catch((e) => { - log.error("Did not load shared project for import"); - log.error(e); - setSharedState(SharedState.Failed); - }); - }, [log, shortId]); + navigate(createDataSamplesPageUrl(), { replace: true }); + }, [loadProject, header, projectText, name, navigate, logging, shortId]); + + if (sharedState === SharedState.Failed) { + return ; + } if (sharedState < SharedState.GettingProject) return ( @@ -100,36 +109,40 @@ export const ImportSharedURLPage = () => { toolbarItemsRight={} menuItems={} > - - + + - {sharedState === SharedState.Failed && ( - Error loading project - )} {sharedState === SharedState.GettingHeader && } {sharedState >= SharedState.GettingProject && ( - + <> + + + + )} + {sharedState === SharedState.Complete && ( + <> + {dataset && } + + + )} @@ -140,15 +153,8 @@ export const ImportSharedURLPage = () => { interface ProjectLoadDetailsProps { name: string; setName: (name: string) => void; - sharedState: SharedState; - handleStartSession: () => void; } -const ProjectLoadDetails = ({ - name, - setName, - sharedState, - handleStartSession, -}: ProjectLoadDetailsProps) => { +const ProjectLoadDetails = ({ name, setName }: ProjectLoadDetailsProps) => { const intl = useIntl(); const timestamp = useStore((s) => s.timestamp); const nameLabel = intl.formatMessage({ id: "name-text" }); @@ -159,8 +165,11 @@ const ProjectLoadDetails = ({ return ( <> + + + {timestamp !== undefined && ( - + setName(e.currentTarget.value)} /> - - ( - - ), - }} - /> + + - - + ); +}; + +interface StartSessionButtonProps { + isDisabled: boolean; + isLoading: boolean; + onStartSession: () => void; +} + +const StartSessionButton = ({ + isDisabled, + isLoading, + onStartSession, +}: StartSessionButtonProps) => ( + + + + + +); + +const previewFrame: HTMLChakraProps<"div"> = { + px: 5, + borderWidth: 1, + borderColor: "gray.300", + backgroundColor: "gray.25", + borderRadius: 15, + overflowX: "scroll", + py: 5, +}; + +interface PreviewDataProps { + dataset: ActionData[]; +} + +const PreviewData = ({ dataset }: PreviewDataProps) => { + return ( + <> + + + + + + + + - - - + {dataset.map((action) => ( + + ))} + + ); }; +interface MakeCodePreviewProps { + project: MakeCodeProject; +} + +const MakeCodePreview = ({ project }: MakeCodePreviewProps) => { + const [{ languageId }] = useSettings(); + const makeCodeLang = getMakeCodeLang(languageId); + const scrollableAreaRef = useRef(null); + return ( + <> + + + + + + + + + + + + + ); +}; + +const ErrorPreloading = () => { + const intl = useIntl(); + const titleText = intl.formatMessage({ id: "import-shared-url-error-title" }); + return ( + + + + + + + + ( + + {chunks} + + ), + }} + /> + + + + + + + + ); +}; + +/** + * This hook owns everything relating to preloading a project, except + * for the name as that may be editable prior to loading. Instead let + * it update the name on preload via a callback. + */ +const useProjectPreload = (setName: (name: string) => void) => { + const { shortId } = useParams(); + const logging = useLogging(); + + const [sharedState, setSharedState] = useState(SharedState.None); + + const [header, setHeader] = useState
(); + const [projectText, setProjectText] = useState(); + const [dataset, setDataset] = useState(); + + useEffect(() => { + if (!shortId) return; + let cleanedUp = false; + setSharedState(SharedState.GettingHeader); + logging.event({ + type: "import-shared-project-start", + detail: { shortId }, + }); + fetchSharedHeader(shortId) + .then((header) => { + if (cleanedUp) { + throw new Error("Cancelled"); + } + setSharedState(SharedState.GettingProject); + setHeader(header); + setName(header.name); + return fetchSharedProjectText(header.id); + }) + .then((text) => { + if (cleanedUp) { + throw new Error("Cancelled"); + } + if (text["dataset.json"]) { + // Do this first in case it errors on parse + setDataset( + (JSON.parse(text["dataset.json"]) as DatasetEditorJsonFormat).data + ); + } + setSharedState(SharedState.Complete); + setProjectText(text); + logging.event({ + type: "import-shared-project-preloaded", + detail: { shortId }, + }); + }) + .catch((error: unknown) => { + logging.event({ + type: "import-shared-project-failed", + detail: { shortId, error }, + }); + if (!cleanedUp) { + setSharedState(SharedState.Failed); + } + }); + return () => { + cleanedUp = true; + }; + }, [logging, shortId, setName]); + return { + sharedState, + header, + dataset, + projectText, + name, + }; +}; + const fetchSharedHeader = async (shortId: string): Promise
=> { const headerResponse = await fetch(`https://www.makecode.com/api/${shortId}`); - if (headerResponse.status !== 200) { - throw "Network errorr"; + if (!headerResponse.ok) { + throw new Error("Network errorr"); } const header = (await headerResponse.json()) as Header; if (!header || !header.id || !header.name) { @@ -243,12 +452,12 @@ const fetchSharedProjectText = async (longId: string): Promise => { const textResponse = await fetch( `https://www.makecode.com/api/${longId}/text` ); - if (textResponse.status !== 200) { - throw "Network errorr"; + if (!textResponse.ok) { + throw new Error("Network errorr"); } const text = (await textResponse.json()) as ScriptText; if (typeof text !== "object") { - throw "Error downloding project"; + throw new Error("Error downloding project"); } return text; }; From e2f9ae30b52f11c34a672f6f51224ff5c3b3157a Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Thu, 25 Sep 2025 14:33:01 +0100 Subject: [PATCH 05/23] Feedback following review --- lang/ui.ca.json | 8 +++++++ lang/ui.en.json | 8 +++++++ lang/ui.es-es.json | 8 +++++++ lang/ui.ja.json | 8 +++++++ lang/ui.ko.json | 8 +++++++ lang/ui.lol.json | 8 +++++++ lang/ui.nl.json | 8 +++++++ lang/ui.pl.json | 8 +++++++ lang/ui.pt-br.json | 8 +++++++ lang/ui.zh-tw.json | 8 +++++++ src/messages/ui.ca.json | 26 ++++++++++++++++++++++ src/messages/ui.en.json | 26 ++++++++++++++++++++++ src/messages/ui.es-es.json | 26 ++++++++++++++++++++++ src/messages/ui.ja.json | 26 ++++++++++++++++++++++ src/messages/ui.ko.json | 26 ++++++++++++++++++++++ src/messages/ui.lol.json | 26 ++++++++++++++++++++++ src/messages/ui.nl.json | 26 ++++++++++++++++++++++ src/messages/ui.pl.json | 26 ++++++++++++++++++++++ src/messages/ui.pt-br.json | 26 ++++++++++++++++++++++ src/messages/ui.zh-tw.json | 26 ++++++++++++++++++++++ src/pages/ImportSharedURLPage.tsx | 36 +++++++++++++++---------------- 21 files changed, 358 insertions(+), 18 deletions(-) diff --git a/lang/ui.ca.json b/lang/ui.ca.json index 0a1c35fce..8920d243b 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Obre el fitxer quan es deixa anar", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Un altre procés està connectat a aquest dispositiu.", "description": "Connection error dialog" diff --git a/lang/ui.en.json b/lang/ui.en.json index 913b6f51a..4f99c3857 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Open file when dropped", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Another process is connected to this device.", "description": "Connection error dialog" diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index ae6bab169..d608a3383 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Abrir archivo al soltarlo", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Otro proceso está conectado a este dispositivo.", "description": "Connection error dialog" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 5a806170c..353c4e0ab 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -1251,6 +1251,14 @@ "defaultMessage": "ドロップ時にファイルを開く", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "別のプロセスがこのデバイスに接続されています。", "description": "Connection error dialog" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index ba6c8f6e4..130dd5746 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -1251,6 +1251,14 @@ "defaultMessage": "드롭될 때 파일 열기", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "다른 프로세스가 이 장치에 연결되어 있습니다.", "description": "Connection error dialog" diff --git a/lang/ui.lol.json b/lang/ui.lol.json index fb8119e37..32f8c8e30 100644 --- a/lang/ui.lol.json +++ b/lang/ui.lol.json @@ -1251,6 +1251,14 @@ "defaultMessage": "crwdns363228:0crwdne363228:0", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "crwdns363230:0crwdne363230:0", "description": "Connection error dialog" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 159e2fc5b..999b72cdb 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Open bestand wanneer gedropt", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Een ander proces is verbonden met dit apparaat.", "description": "Connection error dialog" diff --git a/lang/ui.pl.json b/lang/ui.pl.json index f3884f09a..47803f935 100644 --- a/lang/ui.pl.json +++ b/lang/ui.pl.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Otwórz plik po upuszczeniu", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Do tego urządzenia podłączony jest inny proces.", "description": "Connection error dialog" diff --git a/lang/ui.pt-br.json b/lang/ui.pt-br.json index 3254f1a06..01238dc27 100644 --- a/lang/ui.pt-br.json +++ b/lang/ui.pt-br.json @@ -1251,6 +1251,14 @@ "defaultMessage": "Abrir arquivo quando solto", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "Outro processo está conectado a este dispositivo.", "description": "Connection error dialog" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index 7f83a482e..bc3042835 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -1251,6 +1251,14 @@ "defaultMessage": "放置時開啟檔案", "description": "Aria label for file drop target" }, + "open-project-action": { + "defaultMessage": "Open project", + "description": "Open project button text" + }, + "open-project-setup-description": { + "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", + "description": "Open project setup description" + }, "other-tabs-body1": { "defaultMessage": "其他程序連線至此裝置。", "description": "Connection error dialog" diff --git a/src/messages/ui.ca.json b/src/messages/ui.ca.json index cba2196b6..ce8768d03 100644 --- a/src/messages/ui.ca.json +++ b/src/messages/ui.ca.json @@ -2139,6 +2139,32 @@ "value": "Obre el fitxer quan es deixa anar" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index 49d03bd01..4c82508d1 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -2153,6 +2153,32 @@ "value": "Open file when dropped" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.es-es.json b/src/messages/ui.es-es.json index fcd66ca3a..1154add5d 100644 --- a/src/messages/ui.es-es.json +++ b/src/messages/ui.es-es.json @@ -2153,6 +2153,32 @@ "value": "Abrir archivo al soltarlo" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.ja.json b/src/messages/ui.ja.json index 233276e4b..3b35e44e9 100644 --- a/src/messages/ui.ja.json +++ b/src/messages/ui.ja.json @@ -2133,6 +2133,32 @@ "value": "ドロップ時にファイルを開く" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.ko.json b/src/messages/ui.ko.json index 516633f5b..ac648f222 100644 --- a/src/messages/ui.ko.json +++ b/src/messages/ui.ko.json @@ -2141,6 +2141,32 @@ "value": "드롭될 때 파일 열기" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.lol.json b/src/messages/ui.lol.json index d39bcd751..e3b95bb72 100644 --- a/src/messages/ui.lol.json +++ b/src/messages/ui.lol.json @@ -2029,6 +2029,32 @@ "value": "crwdns363228:0crwdne363228:0" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.nl.json b/src/messages/ui.nl.json index dc9e08aea..047e570b5 100644 --- a/src/messages/ui.nl.json +++ b/src/messages/ui.nl.json @@ -2153,6 +2153,32 @@ "value": "Open bestand wanneer gedropt" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.pl.json b/src/messages/ui.pl.json index 516d5502f..c5699f239 100644 --- a/src/messages/ui.pl.json +++ b/src/messages/ui.pl.json @@ -2157,6 +2157,32 @@ "value": "Otwórz plik po upuszczeniu" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.pt-br.json b/src/messages/ui.pt-br.json index 801e3f368..2e3343e46 100644 --- a/src/messages/ui.pt-br.json +++ b/src/messages/ui.pt-br.json @@ -2137,6 +2137,32 @@ "value": "Abrir arquivo quando solto" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.zh-tw.json b/src/messages/ui.zh-tw.json index 716452688..1145d770d 100644 --- a/src/messages/ui.zh-tw.json +++ b/src/messages/ui.zh-tw.json @@ -2149,6 +2149,32 @@ "value": "放置時開啟檔案" } ], + "open-project-action": [ + { + "type": 0, + "value": "Open project" + } + ], + "open-project-setup-description": [ + { + "type": 0, + "value": "Opening this project will overwrite any existing session. You may want to " + }, + { + "children": [ + { + "type": 0, + "value": "save your existing session" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": " first." + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/pages/ImportSharedURLPage.tsx b/src/pages/ImportSharedURLPage.tsx index 85fdc09ad..e0a3de87e 100644 --- a/src/pages/ImportSharedURLPage.tsx +++ b/src/pages/ImportSharedURLPage.tsx @@ -1,4 +1,5 @@ import { + Alert, Button, Grid, Heading, @@ -53,15 +54,14 @@ const contentStackProps: Partial = { borderWidth: [null, 1], borderBottomWidth: 1, borderColor: [null, "gray.300"], - py: [5, 8], - px: [3, 5, 8], + p: [0, 10, 20], minW: [null, null, "xl"], alignItems: "stretch", - width: ["100%", "90%", "80%"], + width: ["full", "full", "3xl", "4xl"], }; const readableProps: Partial = { - width: "65ch", + width: ["full", "65ch"], }; export const ImportSharedURLPage = () => { @@ -109,8 +109,8 @@ export const ImportSharedURLPage = () => { toolbarItemsRight={} menuItems={} > - - + + @@ -145,6 +145,13 @@ export const ImportSharedURLPage = () => { )} + {sharedState === SharedState.Complete && ( + + + + + + )} ); @@ -171,7 +178,7 @@ const ProjectLoadDetails = ({ name, setName }: ProjectLoadDetailsProps) => { {timestamp !== undefined && ( ( - - - - + + + + {titleText} + + + + + + + + + ); }; From bda1f6b72f326291dc2a709d8dcfbae165a6201a Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Mon, 29 Sep 2025 12:51:16 +0100 Subject: [PATCH 14/23] Tweak copy --- lang/ui.ca.json | 64 +++++++++---------- lang/ui.en.json | 64 +++++++++---------- lang/ui.es-es.json | 64 +++++++++---------- lang/ui.ja.json | 64 +++++++++---------- lang/ui.ko.json | 64 +++++++++---------- lang/ui.lol.json | 64 +++++++++---------- lang/ui.nl.json | 64 +++++++++---------- lang/ui.pl.json | 64 +++++++++---------- lang/ui.pt-br.json | 64 +++++++++---------- lang/ui.zh-tw.json | 64 +++++++++---------- src/messages/ui.ca.json | 96 ++++++++++++++--------------- src/messages/ui.en.json | 96 ++++++++++++++--------------- src/messages/ui.es-es.json | 96 ++++++++++++++--------------- src/messages/ui.ja.json | 96 ++++++++++++++--------------- src/messages/ui.ko.json | 96 ++++++++++++++--------------- src/messages/ui.lol.json | 96 ++++++++++++++--------------- src/messages/ui.nl.json | 96 ++++++++++++++--------------- src/messages/ui.pl.json | 96 ++++++++++++++--------------- src/messages/ui.pt-br.json | 96 ++++++++++++++--------------- src/messages/ui.zh-tw.json | 96 ++++++++++++++--------------- src/pages/OpenSharedProjectPage.tsx | 24 ++++---- 21 files changed, 813 insertions(+), 811 deletions(-) diff --git a/lang/ui.ca.json b/lang/ui.ca.json index 8920d243b..f9a3968b0 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -71,6 +71,10 @@ "defaultMessage": "Edita mostres de dades", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "Et recomanem Google Chrome o Microsoft Edge perquè puguis connectar-te directament a la micro:bit.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Mostra les funcions de dades", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Barra d'eines de mostres de dades", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Tipus d'arxiu no permés", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Torna enrere per seleccionar una micro:bit diferent, o bé desa l'hexadecimal del projecte que es pot transferir a una micro:bit V2 més tard.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Un altre procés està connectat a aquest dispositiu.", "description": "Connection error dialog" diff --git a/lang/ui.en.json b/lang/ui.en.json index 9ac5521c6..fae39fb2d 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -71,6 +71,10 @@ "defaultMessage": "Edit data samples", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "We recommend Google Chrome or Microsoft Edge so you can connect directly to your micro:bit.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Show data features", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Data samples toolbar", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Unsupported file type", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "Failed to load the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Go back to select a different micro:bit, or save the project hex which can be downloaded onto a micro:bit V2 later.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Another process is connected to this device.", "description": "Connection error dialog" diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index d608a3383..f2ebf962e 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -71,6 +71,10 @@ "defaultMessage": "Editar muestras de datos", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "Te recomendamos Google Chrome o Microsoft Edge para que puedas conectarte directamente a tu micro:bit.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Mostrar características de los datos", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Barra de herramientas de muestras de datos", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Tipo de archivo no compatible", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Vuelve atrás para seleccionar un micro:bit diferente o guarda el hexadecimal del proyecto para poder descargarlo más tarde en un micro:bit V2.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Otro proceso está conectado a este dispositivo.", "description": "Connection error dialog" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 353c4e0ab..cde1065d9 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -71,6 +71,10 @@ "defaultMessage": "データサンプルを編集", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "micro:bitに直接接続できるように、Google ChromeまたはMicrosoft Edgeをお勧めします。", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "データ機能を表示", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "データサンプルツールバー", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "対応していないファイル形式です", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "戻って別のmicro:bitを選ぶか、プロジェクトのhexを保存して、micro:bit V2にダウンロードしてください。", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "別のプロセスがこのデバイスに接続されています。", "description": "Connection error dialog" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index 130dd5746..7173669d6 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -71,6 +71,10 @@ "defaultMessage": "데이터 샘플 편집", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "micro:bit에 바로 연결하려면 Google Chrome 또는 Microsoft Edge를 사용하는 것이 좋습니다.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "데이터 기능 표시", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "데이터 샘플 도구 모음", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "지원되지 않는 파일 유형", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "뒤로 돌아가 다른 micro:bit를 선택하거나, 프로젝트 hex를 저장하세요. 프로젝트 hex는 나중에 micro:bit V2에 다운로드할 수 있습니다.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "다른 프로세스가 이 장치에 연결되어 있습니다.", "description": "Connection error dialog" diff --git a/lang/ui.lol.json b/lang/ui.lol.json index 32f8c8e30..52bbd0f6b 100644 --- a/lang/ui.lol.json +++ b/lang/ui.lol.json @@ -71,6 +71,10 @@ "defaultMessage": "crwdns362678:0crwdne362678:0", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "crwdns362680:0crwdne362680:0", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "crwdns362856:0crwdne362856:0", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "crwdns362858:0crwdne362858:0", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "crwdns363048:0crwdne363048:0", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "crwdns363050:0crwdne363050:0", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "crwdns363230:0crwdne363230:0", "description": "Connection error dialog" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 999b72cdb..9a5c0a2d6 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -71,6 +71,10 @@ "defaultMessage": "Bewerk data samples", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "We raden Google Chrome of Microsoft Edge aan, zodat je direct verbinding kunt maken met je micro:bit.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Toon data-functies", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Data samples werkbalk", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Niet-ondersteund bestandstype", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Ga terug naar een andere micro:bit, of sla de project-hex op die later kan worden gedownload naar een micro:bit V2", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Een ander proces is verbonden met dit apparaat.", "description": "Connection error dialog" diff --git a/lang/ui.pl.json b/lang/ui.pl.json index 47803f935..448d32824 100644 --- a/lang/ui.pl.json +++ b/lang/ui.pl.json @@ -71,6 +71,10 @@ "defaultMessage": "Edytuj próbki danych", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "Zalecamy Google Chrome lub Microsoft Edge, abyś mógł połączyć się bezpośrednio ze swoim micro:bitem.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Pokaż właściwości danych", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Pasek narzędzi dla próbek danych", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Nieobsługiwany typ pliku", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Wróć, aby wybrać inny micro:bit lub zapisz hex projektu, który można pobrać na micro:bit V2 później.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Do tego urządzenia podłączony jest inny proces.", "description": "Connection error dialog" diff --git a/lang/ui.pt-br.json b/lang/ui.pt-br.json index 01238dc27..d3e995d6e 100644 --- a/lang/ui.pt-br.json +++ b/lang/ui.pt-br.json @@ -71,6 +71,10 @@ "defaultMessage": "Editar amostras de dados", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "Recomendamos o Google Chrome ou o Microsoft Edge para que você possa se conectar diretamente ao seu micro:bit.", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "Mostrar recursos de dados", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "Barra de ferramentas de amostras de dados", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "Tipo de arquivo não suportado.", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "Volte para selecionar um micro:bit diferente, ou salve o arquivo hex do projeto, que pode ser baixado em um micro:bit V2 mais tarde.", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "Outro processo está conectado a este dispositivo.", "description": "Connection error dialog" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index bc3042835..6b22d93df 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -71,6 +71,10 @@ "defaultMessage": "編輯數據樣本", "description": "Back button text" }, + "blocks-preview-title": { + "defaultMessage": "Blocks preview", + "description": "Blocks preview heading text" + }, "bluetooth-unsupported-advice": { "defaultMessage": "我們建議您使用 Google Chrome 或 Microsoft Edge,以便您能夠直接連線到您的 micro:bit。", "description": "Note on supported browsers" @@ -427,6 +431,10 @@ "defaultMessage": "顯示數據功能", "description": "Show data features button text" }, + "data-preview-title": { + "defaultMessage": "Data preview", + "description": "Data preview heading text" + }, "data-samples-actions-region": { "defaultMessage": "數據樣本工具列", "description": "Region label for data samples actions" @@ -839,38 +847,6 @@ "defaultMessage": "不支援的檔案類型", "description": "Title of import error dialog" }, - "import-shared-url-blocks-preview-description": { - "defaultMessage": "Preview of the MakeCode code contained within this project.", - "description": "Blocks preview description text" - }, - "import-shared-url-blocks-preview-title": { - "defaultMessage": "Blocks preview", - "description": "Blocks preview heading text" - }, - "import-shared-url-data-preview-description": { - "defaultMessage": "Preview of the actions and data contained within this project.", - "description": "Data preview description text" - }, - "import-shared-url-data-preview-title": { - "defaultMessage": "Data preview", - "description": "Data preview heading text" - }, - "import-shared-url-description": { - "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", - "description": "Import shared CreateAI project description" - }, - "import-shared-url-error-description": { - "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", - "description": "Import shared CreateAI error description" - }, - "import-shared-url-error-title": { - "defaultMessage": "An error occurred while fetching the shared project", - "description": "Import shared CreateAI error page title" - }, - "import-shared-url-title": { - "defaultMessage": "Open shared CreateAI project", - "description": "Import shared CreateAI project title" - }, "incompatible-device-body-alt": { "defaultMessage": "返回選擇不同的 micro:bit,或儲存專案十六進位檔案,稍後可以將其下載到 micro:bit V2 上。", "description": "Incompatible device dialog body text" @@ -1259,6 +1235,30 @@ "defaultMessage": "Opening this project will overwrite any existing session. You may want to save your existing session first.", "description": "Open project setup description" }, + "open-shared-project-blocks-preview-description": { + "defaultMessage": "Preview of the MakeCode code contained within this project.", + "description": "Blocks preview description text" + }, + "open-shared-project-data-preview-description": { + "defaultMessage": "Preview of the actions and data contained within this project.", + "description": "Data preview description text" + }, + "open-shared-project-description": { + "defaultMessage": "This is a Microsoft MakeCode shared project compatible with CreateAI.", + "description": "Import shared CreateAI project description" + }, + "open-shared-project-error-description": { + "defaultMessage": "Check the link you followed is correct, and make sure you are connected to the internet before trying again.", + "description": "Import shared CreateAI error description" + }, + "open-shared-project-error-title": { + "defaultMessage": "Failed to load the shared project", + "description": "Import shared CreateAI error page title" + }, + "open-shared-project-title": { + "defaultMessage": "Open shared CreateAI project", + "description": "Import shared CreateAI project title" + }, "other-tabs-body1": { "defaultMessage": "其他程序連線至此裝置。", "description": "Connection error dialog" diff --git a/src/messages/ui.ca.json b/src/messages/ui.ca.json index ce8768d03..c24d86006 100644 --- a/src/messages/ui.ca.json +++ b/src/messages/ui.ca.json @@ -141,6 +141,12 @@ "value": "Edita mostres de dades" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Mostra les funcions de dades" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1433,54 +1445,6 @@ "value": "Tipus d'arxiu no permés" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2165,6 +2129,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index 86437f2d8..fae5d05e6 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -141,6 +141,12 @@ "value": "Edit data samples" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Show data features" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1447,54 +1459,6 @@ "value": "Unsupported file type" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "Failed to load the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2179,6 +2143,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.es-es.json b/src/messages/ui.es-es.json index 1154add5d..e3ab100cb 100644 --- a/src/messages/ui.es-es.json +++ b/src/messages/ui.es-es.json @@ -141,6 +141,12 @@ "value": "Editar muestras de datos" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Mostrar características de los datos" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1447,54 +1459,6 @@ "value": "Tipo de archivo no compatible" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2179,6 +2143,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.ja.json b/src/messages/ui.ja.json index 3b35e44e9..d353a5467 100644 --- a/src/messages/ui.ja.json +++ b/src/messages/ui.ja.json @@ -137,6 +137,12 @@ "value": "データサンプルを編集" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -707,6 +713,12 @@ "value": "データ機能を表示" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1427,54 +1439,6 @@ "value": "対応していないファイル形式です" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2159,6 +2123,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.ko.json b/src/messages/ui.ko.json index ac648f222..f574bfb4f 100644 --- a/src/messages/ui.ko.json +++ b/src/messages/ui.ko.json @@ -137,6 +137,12 @@ "value": "데이터 샘플 편집" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -711,6 +717,12 @@ "value": "데이터 기능 표시" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1435,54 +1447,6 @@ "value": "지원되지 않는 파일 유형" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2167,6 +2131,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.lol.json b/src/messages/ui.lol.json index e3b95bb72..fd3657199 100644 --- a/src/messages/ui.lol.json +++ b/src/messages/ui.lol.json @@ -131,6 +131,12 @@ "value": "crwdns362678:0crwdne362678:0" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -689,6 +695,12 @@ "value": "crwdns362856:0crwdne362856:0" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1379,54 +1391,6 @@ "value": "crwdns363048:0crwdne363048:0" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2055,6 +2019,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.nl.json b/src/messages/ui.nl.json index 047e570b5..a681b11fc 100644 --- a/src/messages/ui.nl.json +++ b/src/messages/ui.nl.json @@ -141,6 +141,12 @@ "value": "Bewerk data samples" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Toon data-functies" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1447,54 +1459,6 @@ "value": "Niet-ondersteund bestandstype" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2179,6 +2143,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.pl.json b/src/messages/ui.pl.json index c5699f239..f6169a51b 100644 --- a/src/messages/ui.pl.json +++ b/src/messages/ui.pl.json @@ -141,6 +141,12 @@ "value": "Edytuj próbki danych" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Pokaż właściwości danych" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1451,54 +1463,6 @@ "value": "Nieobsługiwany typ pliku" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2183,6 +2147,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.pt-br.json b/src/messages/ui.pt-br.json index 2e3343e46..0c9ec329f 100644 --- a/src/messages/ui.pt-br.json +++ b/src/messages/ui.pt-br.json @@ -141,6 +141,12 @@ "value": "Editar amostras de dados" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "Mostrar recursos de dados" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1447,54 +1459,6 @@ "value": "Tipo de arquivo não suportado." } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2163,6 +2127,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/messages/ui.zh-tw.json b/src/messages/ui.zh-tw.json index 1145d770d..f9bc0c760 100644 --- a/src/messages/ui.zh-tw.json +++ b/src/messages/ui.zh-tw.json @@ -145,6 +145,12 @@ "value": "編輯數據樣本" } ], + "blocks-preview-title": [ + { + "type": 0, + "value": "Blocks preview" + } + ], "bluetooth-unsupported-advice": [ { "type": 0, @@ -719,6 +725,12 @@ "value": "顯示數據功能" } ], + "data-preview-title": [ + { + "type": 0, + "value": "Data preview" + } + ], "data-samples-actions-region": [ { "type": 0, @@ -1443,54 +1455,6 @@ "value": "不支援的檔案類型" } ], - "import-shared-url-blocks-preview-description": [ - { - "type": 0, - "value": "Preview of the MakeCode code contained within this project." - } - ], - "import-shared-url-blocks-preview-title": [ - { - "type": 0, - "value": "Blocks preview" - } - ], - "import-shared-url-data-preview-description": [ - { - "type": 0, - "value": "Preview of the actions and data contained within this project." - } - ], - "import-shared-url-data-preview-title": [ - { - "type": 0, - "value": "Data preview" - } - ], - "import-shared-url-description": [ - { - "type": 0, - "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." - } - ], - "import-shared-url-error-description": [ - { - "type": 0, - "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." - } - ], - "import-shared-url-error-title": [ - { - "type": 0, - "value": "An error occurred while fetching the shared project" - } - ], - "import-shared-url-title": [ - { - "type": 0, - "value": "Open shared CreateAI project" - } - ], "incompatible-device-body-alt": [ { "type": 0, @@ -2175,6 +2139,42 @@ "value": " first." } ], + "open-shared-project-blocks-preview-description": [ + { + "type": 0, + "value": "Preview of the MakeCode code contained within this project." + } + ], + "open-shared-project-data-preview-description": [ + { + "type": 0, + "value": "Preview of the actions and data contained within this project." + } + ], + "open-shared-project-description": [ + { + "type": 0, + "value": "This is a Microsoft MakeCode shared project compatible with CreateAI." + } + ], + "open-shared-project-error-description": [ + { + "type": 0, + "value": "Check the link you followed is correct, and make sure you are connected to the internet before trying again." + } + ], + "open-shared-project-error-title": [ + { + "type": 0, + "value": "Failed to load the shared project" + } + ], + "open-shared-project-title": [ + { + "type": 0, + "value": "Open shared CreateAI project" + } + ], "other-tabs-body1": [ { "type": 0, diff --git a/src/pages/OpenSharedProjectPage.tsx b/src/pages/OpenSharedProjectPage.tsx index 48ac8e575..c5c89257e 100644 --- a/src/pages/OpenSharedProjectPage.tsx +++ b/src/pages/OpenSharedProjectPage.tsx @@ -93,14 +93,14 @@ export const OpenSharedProjectPage = () => { if (sharedState < SharedState.GettingProject) return ( } menuItems={} > - + @@ -113,14 +113,14 @@ export const OpenSharedProjectPage = () => { return ( } menuItems={} > - + {sharedState === SharedState.GettingHeader && } {sharedState >= SharedState.GettingProject && ( @@ -197,7 +197,7 @@ const ProjectLoadDetails = ({ name, setName }: ProjectLoadDetailsProps) => { return ( <> - + {timestamp !== undefined && ( @@ -278,10 +278,10 @@ const PreviewData = ({ dataset }: PreviewDataProps) => { return ( <> - + - + @@ -312,10 +312,10 @@ const MakeCodePreview = ({ project }: MakeCodePreviewProps) => { return ( <> - + - + { const ErrorPreloading = () => { const intl = useIntl(); - const titleText = intl.formatMessage({ id: "import-shared-url-error-title" }); + const titleText = intl.formatMessage({ + id: "open-shared-project-error-title", + }); return ( @@ -353,7 +355,7 @@ const ErrorPreloading = () => { {titleText} - +