@dxos/plugin-youtube 0.8.3 → 0.8.4-main.74a063c4e0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/blueprints/index.mjs +49 -8
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/{chunk-C26XKDK2.mjs → chunk-FEQD5TPI.mjs} +4 -4
- package/dist/lib/browser/{chunk-C26XKDK2.mjs.map → chunk-FEQD5TPI.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-P67QEKBQ.mjs → chunk-GIRFSTHR.mjs} +6 -8
- package/dist/lib/browser/chunk-GIRFSTHR.mjs.map +7 -0
- package/dist/lib/browser/chunk-GTIWG45H.mjs +157 -0
- package/dist/lib/browser/chunk-GTIWG45H.mjs.map +7 -0
- package/dist/lib/browser/{clear-synced-videos-EVMJIZPD.mjs → clear-synced-videos-NZIWAVGL.mjs} +7 -8
- package/dist/lib/browser/clear-synced-videos-NZIWAVGL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +86 -81
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{sync-423Q4BDD.mjs → sync-T34US6NO.mjs} +18 -19
- package/dist/lib/browser/sync-T34US6NO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -4
- package/dist/lib/node-esm/blueprints/index.mjs +49 -8
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-JSGRZMG3.mjs → chunk-A3SKNJFU.mjs} +6 -8
- package/dist/lib/node-esm/chunk-A3SKNJFU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs → chunk-Q3TVMR5B.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-JM5SBBP5.mjs.map → chunk-Q3TVMR5B.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-YOE54ALJ.mjs +158 -0
- package/dist/lib/node-esm/chunk-YOE54ALJ.mjs.map +7 -0
- package/dist/lib/node-esm/{clear-synced-videos-5UCH6XHL.mjs → clear-synced-videos-ZX7KBPGS.mjs} +7 -8
- package/dist/lib/{browser/clear-synced-videos-EVMJIZPD.mjs.map → node-esm/clear-synced-videos-ZX7KBPGS.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +86 -81
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{sync-CEF5DX2J.mjs → sync-RQYQ5LII.mjs} +18 -19
- package/dist/lib/node-esm/sync-RQYQ5LII.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -4
- package/dist/types/src/YouTubePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelArticle/index.d.ts +1 -2
- package/dist/types/src/containers/ChannelArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelSettings/index.d.ts +1 -2
- package/dist/types/src/containers/ChannelSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts +2 -7
- package/dist/types/src/containers/VideoArticle/VideoArticle.d.ts.map +1 -1
- package/dist/types/src/containers/VideoArticle/index.d.ts +1 -2
- package/dist/types/src/containers/VideoArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/VideoCard/VideoCard.d.ts +2 -2
- package/dist/types/src/containers/VideoCard/VideoCard.d.ts.map +1 -1
- package/dist/types/src/containers/VideoCard/index.d.ts +1 -2
- package/dist/types/src/containers/VideoCard/index.d.ts.map +1 -1
- package/dist/types/src/operations/apis/youtube/api.d.ts.map +1 -1
- package/dist/types/src/operations/clear-synced-videos.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +9 -5
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/sync.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +38 -38
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +28 -3
- package/dist/types/src/types/Channel.d.ts.map +1 -1
- package/dist/types/src/types/Video.d.ts +22 -0
- package/dist/types/src/types/Video.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +48 -40
- package/src/YouTubePlugin.tsx +12 -6
- package/src/blueprints/youtube.ts +1 -1
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +29 -33
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +1 -1
- package/src/capabilities/index.ts +7 -4
- package/src/capabilities/migrations.ts +35 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +16 -18
- package/src/containers/ChannelArticle/ChannelArticle.tsx +1 -1
- package/src/containers/ChannelArticle/index.ts +1 -3
- package/src/containers/ChannelSettings/index.ts +1 -3
- package/src/containers/VideoArticle/VideoArticle.tsx +2 -7
- package/src/containers/VideoArticle/index.ts +1 -3
- package/src/containers/VideoCard/VideoCard.tsx +2 -2
- package/src/containers/VideoCard/index.ts +1 -3
- package/src/operations/apis/youtube/api.ts +0 -1
- package/src/operations/clear-synced-videos.ts +0 -1
- package/src/operations/definitions.ts +3 -3
- package/src/operations/sync.ts +0 -1
- package/src/translations.ts +38 -38
- package/src/types/Channel.ts +18 -1
- package/src/types/Video.ts +25 -1
- package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs +0 -90
- package/dist/lib/browser/ChannelArticle-CDQR4BBY.mjs.map +0 -7
- package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs +0 -28
- package/dist/lib/browser/ChannelSettings-ZYUNW3VS.mjs.map +0 -7
- package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs +0 -76
- package/dist/lib/browser/VideoArticle-FC4A6E7B.mjs.map +0 -7
- package/dist/lib/browser/VideoCard-CCPXDCB7.mjs +0 -64
- package/dist/lib/browser/VideoCard-CCPXDCB7.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs +0 -195
- package/dist/lib/browser/app-graph-builder-MJY6A6SN.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs +0 -22
- package/dist/lib/browser/blueprint-definition-FRYUYJ22.mjs.map +0 -7
- package/dist/lib/browser/chunk-DFRSBBSO.mjs +0 -21
- package/dist/lib/browser/chunk-DFRSBBSO.mjs.map +0 -7
- package/dist/lib/browser/chunk-GFRR4TTX.mjs +0 -72
- package/dist/lib/browser/chunk-GFRR4TTX.mjs.map +0 -7
- package/dist/lib/browser/chunk-MUE22YUM.mjs +0 -57
- package/dist/lib/browser/chunk-MUE22YUM.mjs.map +0 -7
- package/dist/lib/browser/chunk-P67QEKBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YMDT37TA.mjs +0 -62
- package/dist/lib/browser/chunk-YMDT37TA.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z3DGTMKC.mjs +0 -8
- package/dist/lib/browser/chunk-Z3DGTMKC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EDA5VYDC.mjs +0 -77
- package/dist/lib/browser/react-surface-EDA5VYDC.mjs.map +0 -7
- package/dist/lib/browser/sync-423Q4BDD.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs +0 -91
- package/dist/lib/node-esm/ChannelArticle-GQ64BO7V.mjs.map +0 -7
- package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs +0 -29
- package/dist/lib/node-esm/ChannelSettings-DM2HWNKO.mjs.map +0 -7
- package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs +0 -77
- package/dist/lib/node-esm/VideoArticle-WLTWZO3K.mjs.map +0 -7
- package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs +0 -65
- package/dist/lib/node-esm/VideoCard-FOWQZK75.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs +0 -196
- package/dist/lib/node-esm/app-graph-builder-IU5TBAXN.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs +0 -23
- package/dist/lib/node-esm/blueprint-definition-W264MZ3D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5KNC2JMP.mjs +0 -58
- package/dist/lib/node-esm/chunk-5KNC2JMP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs +0 -73
- package/dist/lib/node-esm/chunk-6BUJ2DQX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CX6MV3QM.mjs +0 -23
- package/dist/lib/node-esm/chunk-CX6MV3QM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs +0 -63
- package/dist/lib/node-esm/chunk-CZSLL3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JSGRZMG3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-M4S6BE47.mjs +0 -10
- package/dist/lib/node-esm/chunk-M4S6BE47.mjs.map +0 -7
- package/dist/lib/node-esm/clear-synced-videos-5UCH6XHL.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs +0 -78
- package/dist/lib/node-esm/react-surface-5DJAQPHJ.mjs.map +0 -7
- package/dist/lib/node-esm/sync-CEF5DX2J.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{blueprint-definition/blueprint-definition.d.ts → blueprint-definition.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-youtube",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.74a063c4e0",
|
|
4
4
|
"description": "DXOS YouTube feed plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#blueprints": "./src/blueprints/index.ts",
|
|
17
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#meta": "./src/meta.ts",
|
|
20
|
+
"#operations": "./src/operations/index.ts",
|
|
21
|
+
"#types": "./src/types/index.ts"
|
|
22
|
+
},
|
|
15
23
|
"exports": {
|
|
16
24
|
".": {
|
|
17
25
|
"source": "./src/index.ts",
|
|
@@ -53,35 +61,35 @@
|
|
|
53
61
|
"@radix-ui/react-context": "1.1.1",
|
|
54
62
|
"effect": "3.20.0",
|
|
55
63
|
"youtube-caption-extractor": "^1.9.1",
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/echo
|
|
63
|
-
"@dxos/echo": "0.8.
|
|
64
|
-
"@dxos/effect": "0.8.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/react-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/util": "0.8.
|
|
84
|
-
"@dxos/
|
|
64
|
+
"@dxos/app-framework": "0.8.4-main.74a063c4e0",
|
|
65
|
+
"@dxos/blueprints": "0.8.4-main.74a063c4e0",
|
|
66
|
+
"@dxos/async": "0.8.4-main.74a063c4e0",
|
|
67
|
+
"@dxos/client": "0.8.4-main.74a063c4e0",
|
|
68
|
+
"@dxos/debug": "0.8.4-main.74a063c4e0",
|
|
69
|
+
"@dxos/echo-atom": "0.8.4-main.74a063c4e0",
|
|
70
|
+
"@dxos/echo": "0.8.4-main.74a063c4e0",
|
|
71
|
+
"@dxos/echo-db": "0.8.4-main.74a063c4e0",
|
|
72
|
+
"@dxos/effect": "0.8.4-main.74a063c4e0",
|
|
73
|
+
"@dxos/functions": "0.8.4-main.74a063c4e0",
|
|
74
|
+
"@dxos/errors": "0.8.4-main.74a063c4e0",
|
|
75
|
+
"@dxos/invariant": "0.8.4-main.74a063c4e0",
|
|
76
|
+
"@dxos/keys": "0.8.4-main.74a063c4e0",
|
|
77
|
+
"@dxos/operation": "0.8.4-main.74a063c4e0",
|
|
78
|
+
"@dxos/log": "0.8.4-main.74a063c4e0",
|
|
79
|
+
"@dxos/plugin-attention": "0.8.4-main.74a063c4e0",
|
|
80
|
+
"@dxos/app-toolkit": "0.8.4-main.74a063c4e0",
|
|
81
|
+
"@dxos/plugin-deck": "0.8.4-main.74a063c4e0",
|
|
82
|
+
"@dxos/plugin-automation": "0.8.4-main.74a063c4e0",
|
|
83
|
+
"@dxos/plugin-graph": "0.8.4-main.74a063c4e0",
|
|
84
|
+
"@dxos/plugin-space": "0.8.4-main.74a063c4e0",
|
|
85
|
+
"@dxos/plugin-client": "0.8.4-main.74a063c4e0",
|
|
86
|
+
"@dxos/react-client": "0.8.4-main.74a063c4e0",
|
|
87
|
+
"@dxos/react-ui": "0.8.4-main.74a063c4e0",
|
|
88
|
+
"@dxos/react-ui-stack": "0.8.4-main.74a063c4e0",
|
|
89
|
+
"@dxos/schema": "0.8.4-main.74a063c4e0",
|
|
90
|
+
"@dxos/react-ui-attention": "0.8.4-main.74a063c4e0",
|
|
91
|
+
"@dxos/util": "0.8.4-main.74a063c4e0",
|
|
92
|
+
"@dxos/types": "0.8.4-main.74a063c4e0"
|
|
85
93
|
},
|
|
86
94
|
"devDependencies": {
|
|
87
95
|
"@types/react": "~19.2.7",
|
|
@@ -89,14 +97,14 @@
|
|
|
89
97
|
"react": "~19.2.3",
|
|
90
98
|
"react-dom": "~19.2.3",
|
|
91
99
|
"vite": "^7.1.11",
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/storybook-utils": "0.8.
|
|
99
|
-
"@dxos/ui-theme": "0.8.
|
|
100
|
+
"@dxos/config": "0.8.4-main.74a063c4e0",
|
|
101
|
+
"@dxos/protocols": "0.8.4-main.74a063c4e0",
|
|
102
|
+
"@dxos/plugin-testing": "0.8.4-main.74a063c4e0",
|
|
103
|
+
"@dxos/plugin-theme": "0.8.4-main.74a063c4e0",
|
|
104
|
+
"@dxos/random": "0.8.4-main.74a063c4e0",
|
|
105
|
+
"@dxos/react-ui": "0.8.4-main.74a063c4e0",
|
|
106
|
+
"@dxos/storybook-utils": "0.8.4-main.74a063c4e0",
|
|
107
|
+
"@dxos/ui-theme": "0.8.4-main.74a063c4e0"
|
|
100
108
|
},
|
|
101
109
|
"peerDependencies": {
|
|
102
110
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -104,8 +112,8 @@
|
|
|
104
112
|
"effect": "3.20.0",
|
|
105
113
|
"react": "~19.2.3",
|
|
106
114
|
"react-dom": "~19.2.3",
|
|
107
|
-
"@dxos/react-ui": "0.8.
|
|
108
|
-
"@dxos/ui-theme": "0.8.
|
|
115
|
+
"@dxos/react-ui": "0.8.4-main.74a063c4e0",
|
|
116
|
+
"@dxos/ui-theme": "0.8.4-main.74a063c4e0"
|
|
109
117
|
},
|
|
110
118
|
"publishConfig": {
|
|
111
119
|
"access": "public"
|
package/src/YouTubePlugin.tsx
CHANGED
|
@@ -9,15 +9,17 @@ import { ActivationEvent, Plugin } from '@dxos/app-framework';
|
|
|
9
9
|
import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
|
|
10
10
|
import { Annotation } from '@dxos/echo';
|
|
11
11
|
import { Operation } from '@dxos/operation';
|
|
12
|
-
import { AttentionEvents } from '@dxos/plugin-attention';
|
|
13
|
-
import {
|
|
12
|
+
import { AttentionEvents } from '@dxos/plugin-attention/types';
|
|
13
|
+
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
14
14
|
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
15
|
+
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
16
|
+
|
|
17
|
+
import { YouTubeBlueprint } from '#blueprints';
|
|
18
|
+
import { AppGraphBuilder, BlueprintDefinition, Migrations, ReactSurface } from '#capabilities';
|
|
19
|
+
import { meta } from '#meta';
|
|
20
|
+
import { Channel, Video } from '#types';
|
|
15
21
|
|
|
16
|
-
import { YouTubeBlueprint } from './blueprints';
|
|
17
|
-
import { AppGraphBuilder, BlueprintDefinition, ReactSurface } from './capabilities';
|
|
18
|
-
import { meta } from './meta';
|
|
19
22
|
import { translations } from './translations';
|
|
20
|
-
import { Channel, Video } from './types';
|
|
21
23
|
|
|
22
24
|
export const YouTubePlugin = Plugin.define(meta).pipe(
|
|
23
25
|
AppPlugin.addAppGraphModule({
|
|
@@ -62,5 +64,9 @@ export const YouTubePlugin = Plugin.define(meta).pipe(
|
|
|
62
64
|
}),
|
|
63
65
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
64
66
|
AppPlugin.addTranslationsModule({ translations }),
|
|
67
|
+
Plugin.addModule({
|
|
68
|
+
activatesOn: ClientEvents.SetupMigration,
|
|
69
|
+
activate: Migrations,
|
|
70
|
+
}),
|
|
65
71
|
Plugin.make,
|
|
66
72
|
);
|
|
@@ -6,7 +6,7 @@ import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
|
6
6
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
7
|
import { trim } from '@dxos/util';
|
|
8
8
|
|
|
9
|
-
import { ClearSyncedVideos, Sync } from '
|
|
9
|
+
import { ClearSyncedVideos, Sync } from '#operations';
|
|
10
10
|
|
|
11
11
|
const BLUEPRINT_KEY = 'dxos.org/blueprint/youtube';
|
|
12
12
|
|
|
@@ -7,20 +7,20 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
|
|
9
9
|
import { Capability } from '@dxos/app-framework';
|
|
10
|
-
import { AppCapabilities,
|
|
10
|
+
import { AppCapabilities, AppNode, LayoutOperation } from '@dxos/app-toolkit';
|
|
11
11
|
import { type Feed, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
12
12
|
import { AtomQuery, AtomRef } from '@dxos/echo-atom';
|
|
13
13
|
import { invariant } from '@dxos/invariant';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
15
|
import { Operation } from '@dxos/operation';
|
|
16
|
-
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
17
|
-
import { AutomationCapabilities
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
16
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention/types';
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
19
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
20
20
|
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { Channel, Video } from '
|
|
21
|
+
import { meta } from '#meta';
|
|
22
|
+
import { ClearSyncedVideos, Sync } from '#operations';
|
|
23
|
+
import { Channel, Video } from '#types';
|
|
24
24
|
|
|
25
25
|
export default Capability.makeModule(
|
|
26
26
|
Effect.fnUntraced(function* () {
|
|
@@ -37,7 +37,7 @@ export default Capability.makeModule(
|
|
|
37
37
|
|
|
38
38
|
const extensions = yield* Effect.all([
|
|
39
39
|
GraphBuilder.createExtension({
|
|
40
|
-
id:
|
|
40
|
+
id: 'channel-video',
|
|
41
41
|
match: (node) =>
|
|
42
42
|
Channel.instanceOf(node.data) ? Option.some({ channel: node.data, nodeId: node.id }) : Option.none(),
|
|
43
43
|
connector: (matched, get) => {
|
|
@@ -56,26 +56,22 @@ export default Capability.makeModule(
|
|
|
56
56
|
),
|
|
57
57
|
)[0];
|
|
58
58
|
return Effect.succeed([
|
|
59
|
-
{
|
|
60
|
-
id:
|
|
61
|
-
|
|
59
|
+
AppNode.makeCompanion({
|
|
60
|
+
id: linkedSegment('video'),
|
|
61
|
+
label: ['video.label', { ns: meta.id }],
|
|
62
|
+
icon: 'ph--play--regular',
|
|
62
63
|
data: video ?? 'video',
|
|
63
|
-
|
|
64
|
-
label: ['video label', { ns: meta.id }],
|
|
65
|
-
icon: 'ph--play--regular',
|
|
66
|
-
disposition: 'hidden',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
64
|
+
}),
|
|
69
65
|
]);
|
|
70
66
|
},
|
|
71
67
|
}),
|
|
72
68
|
|
|
73
69
|
GraphBuilder.createExtension({
|
|
74
|
-
id:
|
|
70
|
+
id: 'sync-channel',
|
|
75
71
|
match: whenYouTubeChannel,
|
|
76
72
|
actions: (channel) =>
|
|
77
73
|
Effect.succeed([
|
|
78
|
-
{
|
|
74
|
+
Node.makeAction({
|
|
79
75
|
id: 'sync',
|
|
80
76
|
data: Effect.fnUntraced(function* () {
|
|
81
77
|
const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
@@ -84,7 +80,7 @@ export default Capability.makeModule(
|
|
|
84
80
|
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
85
81
|
yield* Effect.tryPromise(() =>
|
|
86
82
|
runtime.runPromise(
|
|
87
|
-
|
|
83
|
+
Operation.invoke(Sync, {
|
|
88
84
|
channel: Ref.make(channel),
|
|
89
85
|
}),
|
|
90
86
|
),
|
|
@@ -92,22 +88,22 @@ export default Capability.makeModule(
|
|
|
92
88
|
Effect.catchAll((error) => {
|
|
93
89
|
log.catch(error);
|
|
94
90
|
return Operation.invoke(LayoutOperation.AddToast, {
|
|
95
|
-
id:
|
|
91
|
+
id: 'sync-channel-error',
|
|
96
92
|
icon: 'ph--warning--regular',
|
|
97
93
|
duration: 5_000,
|
|
98
|
-
title: ['sync
|
|
99
|
-
closeLabel: ['close
|
|
94
|
+
title: ['sync-channel-error.title', { ns: meta.id }],
|
|
95
|
+
closeLabel: ['close.label', { ns: meta.id }],
|
|
100
96
|
});
|
|
101
97
|
}),
|
|
102
98
|
);
|
|
103
99
|
}),
|
|
104
100
|
properties: {
|
|
105
|
-
label: ['sync
|
|
101
|
+
label: ['sync-channel.label', { ns: meta.id }],
|
|
106
102
|
icon: 'ph--arrows-clockwise--regular',
|
|
107
103
|
disposition: 'list-item',
|
|
108
104
|
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
105
|
+
}),
|
|
106
|
+
Node.makeAction({
|
|
111
107
|
id: 'clear-synced-videos',
|
|
112
108
|
data: Effect.fnUntraced(function* () {
|
|
113
109
|
const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
@@ -116,7 +112,7 @@ export default Capability.makeModule(
|
|
|
116
112
|
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
117
113
|
yield* Effect.tryPromise(() =>
|
|
118
114
|
runtime.runPromise(
|
|
119
|
-
|
|
115
|
+
Operation.invoke(ClearSyncedVideos, {
|
|
120
116
|
channel: Ref.make(channel),
|
|
121
117
|
}),
|
|
122
118
|
),
|
|
@@ -124,21 +120,21 @@ export default Capability.makeModule(
|
|
|
124
120
|
Effect.catchAll((error) => {
|
|
125
121
|
log.catch(error);
|
|
126
122
|
return Operation.invoke(LayoutOperation.AddToast, {
|
|
127
|
-
id:
|
|
123
|
+
id: 'clear-synced-videos-error',
|
|
128
124
|
icon: 'ph--warning--regular',
|
|
129
125
|
duration: 5_000,
|
|
130
|
-
title: ['clear
|
|
131
|
-
closeLabel: ['close
|
|
126
|
+
title: ['clear-synced-videos-error.title', { ns: meta.id }],
|
|
127
|
+
closeLabel: ['close.label', { ns: meta.id }],
|
|
132
128
|
});
|
|
133
129
|
}),
|
|
134
130
|
);
|
|
135
131
|
}),
|
|
136
132
|
properties: {
|
|
137
|
-
label: ['clear
|
|
133
|
+
label: ['clear-synced-videos.label', { ns: meta.id }],
|
|
138
134
|
icon: 'ph--trash--regular',
|
|
139
135
|
disposition: 'list-item',
|
|
140
136
|
},
|
|
141
|
-
},
|
|
137
|
+
}),
|
|
142
138
|
]),
|
|
143
139
|
}),
|
|
144
140
|
]);
|
package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts}
RENAMED
|
@@ -7,7 +7,7 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
|
|
10
|
-
import { YouTubeBlueprint } from '
|
|
10
|
+
import { YouTubeBlueprint } from '#blueprints';
|
|
11
11
|
|
|
12
12
|
const blueprintDefinition = Capability.makeModule<
|
|
13
13
|
[],
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
8
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
9
|
+
export const Migrations = Capability.lazy('YouTubeMigrations', () => import('./migrations'));
|
|
10
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { defineObjectMigration } from '@dxos/client/echo';
|
|
9
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
10
|
+
|
|
11
|
+
import { Channel, Video } from '#types';
|
|
12
|
+
|
|
13
|
+
const identityTransform = async (from: any) => ({ ...from });
|
|
14
|
+
const noopCallback = async () => {};
|
|
15
|
+
|
|
16
|
+
const migrations = [
|
|
17
|
+
defineObjectMigration({
|
|
18
|
+
from: Channel.LegacyYouTubeChannel,
|
|
19
|
+
to: Channel.YouTubeChannel,
|
|
20
|
+
transform: identityTransform,
|
|
21
|
+
onMigration: noopCallback,
|
|
22
|
+
}),
|
|
23
|
+
defineObjectMigration({
|
|
24
|
+
from: Video.LegacyYouTubeVideo,
|
|
25
|
+
to: Video.YouTubeVideo,
|
|
26
|
+
transform: identityTransform,
|
|
27
|
+
onMigration: noopCallback,
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export default Capability.makeModule(
|
|
32
|
+
Effect.fnUntraced(function* () {
|
|
33
|
+
return Capability.contributes(ClientCapabilities.Migration, migrations);
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
@@ -7,46 +7,44 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
|
|
11
|
-
import { ChannelArticle, ChannelSettings, VideoArticle, VideoCard } from '
|
|
12
|
-
import {
|
|
13
|
-
import { Channel, Video } from '../../types';
|
|
12
|
+
import { ChannelArticle, ChannelSettings, VideoArticle, VideoCard } from '#containers';
|
|
13
|
+
import { Channel, Video } from '#types';
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(() =>
|
|
16
16
|
Effect.succeed(
|
|
17
17
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
18
|
Surface.create({
|
|
19
|
-
id:
|
|
19
|
+
id: 'channel',
|
|
20
20
|
role: ['article'],
|
|
21
|
-
filter: (
|
|
22
|
-
Channel.instanceOf(data.subject),
|
|
21
|
+
filter: AppSurface.objectArticle(Channel.YouTubeChannel),
|
|
23
22
|
component: ({ data }) => {
|
|
24
23
|
return <ChannelArticle subject={data.subject} attendableId={data.attendableId} />;
|
|
25
24
|
},
|
|
26
25
|
}),
|
|
27
26
|
Surface.create({
|
|
28
|
-
id:
|
|
27
|
+
id: 'video',
|
|
28
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
29
29
|
role: ['article', 'section'],
|
|
30
|
-
filter: (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Video.instanceOf(data.subject) &&
|
|
35
|
-
Channel.instanceOf(data.companionTo),
|
|
30
|
+
filter: AppSurface.and(
|
|
31
|
+
AppSurface.objectArticle(Video.YouTubeVideo),
|
|
32
|
+
AppSurface.companionArticle(Channel.YouTubeChannel),
|
|
33
|
+
),
|
|
36
34
|
component: ({ data: { attendableId, companionTo, subject }, role }) => {
|
|
37
|
-
return <VideoArticle role={role} subject={subject}
|
|
35
|
+
return <VideoArticle role={role} subject={subject} companionTo={companionTo} attendableId={attendableId} />;
|
|
38
36
|
},
|
|
39
37
|
}),
|
|
40
38
|
Surface.create({
|
|
41
|
-
id:
|
|
39
|
+
id: 'video-card',
|
|
42
40
|
role: 'card--content',
|
|
43
|
-
filter: (
|
|
41
|
+
filter: AppSurface.objectCard(Video.YouTubeVideo),
|
|
44
42
|
component: ({ data: { subject }, role }) => <VideoCard subject={subject} role={role} />,
|
|
45
43
|
}),
|
|
46
44
|
Surface.create({
|
|
47
|
-
id:
|
|
45
|
+
id: 'channel.companion.settings',
|
|
48
46
|
role: 'object-settings',
|
|
49
|
-
filter: (
|
|
47
|
+
filter: AppSurface.objectSettings(Channel.YouTubeChannel),
|
|
50
48
|
component: ({ data }) => <ChannelSettings subject={data.subject} />,
|
|
51
49
|
}),
|
|
52
50
|
]),
|
|
@@ -13,7 +13,7 @@ import * as Video from '../../types/Video';
|
|
|
13
13
|
|
|
14
14
|
export type ChannelArticleProps = {
|
|
15
15
|
subject: Channel.YouTubeChannel;
|
|
16
|
-
attendableId
|
|
16
|
+
attendableId: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const ChannelArticle = ({ subject: channel }: ChannelArticleProps) => {
|
|
@@ -4,17 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
7
8
|
import { Icon, Panel } from '@dxos/react-ui';
|
|
8
9
|
|
|
9
|
-
import * as Channel from '../../types/Channel';
|
|
10
10
|
import * as Video from '../../types/Video';
|
|
11
11
|
|
|
12
|
-
export type VideoArticleProps =
|
|
13
|
-
role: string | string[];
|
|
14
|
-
subject: Video.YouTubeVideo;
|
|
15
|
-
channel: Channel.YouTubeChannel;
|
|
16
|
-
attendableId?: string;
|
|
17
|
-
};
|
|
12
|
+
export type VideoArticleProps = AppSurface.ObjectArticleProps<Video.YouTubeVideo>;
|
|
18
13
|
|
|
19
14
|
export const VideoArticle = ({ subject: video, role }: VideoArticleProps) => {
|
|
20
15
|
const [showPlayer, setShowPlayer] = useState(false);
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { Card, Icon } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import * as Video from '../../types/Video';
|
|
11
11
|
|
|
12
|
-
export type VideoCardProps =
|
|
12
|
+
export type VideoCardProps = AppSurface.ObjectCardProps<Video.YouTubeVideo>;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* YouTube video card with embedded player.
|
|
@@ -9,7 +9,6 @@ import { log } from '@dxos/log';
|
|
|
9
9
|
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
import { Channel, Video } from '../types';
|
|
12
|
-
|
|
13
12
|
import { ClearSyncedVideos } from './definitions';
|
|
14
13
|
|
|
15
14
|
const handler: Operation.WithHandler<typeof ClearSyncedVideos> = ClearSyncedVideos.pipe(
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Operation } from '@dxos/operation';
|
|
6
5
|
import * as Schema from 'effect/Schema';
|
|
7
6
|
|
|
8
7
|
import { Database, Feed, Ref } from '@dxos/echo';
|
|
9
8
|
import { CredentialsService } from '@dxos/functions';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
import { Channel, Video } from '../types';
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ export const Sync = Operation.make({
|
|
|
40
40
|
channelTitle: Schema.String.pipe(Schema.optional),
|
|
41
41
|
}),
|
|
42
42
|
types: [Channel.YouTubeChannel, Video.YouTubeVideo],
|
|
43
|
-
services: [Database.Service, Feed.
|
|
43
|
+
services: [Database.Service, Feed.FeedService, CredentialsService],
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
export const ClearSyncedVideos = Operation.make({
|
|
@@ -58,5 +58,5 @@ export const ClearSyncedVideos = Operation.make({
|
|
|
58
58
|
removedVideos: Schema.Number,
|
|
59
59
|
}),
|
|
60
60
|
types: [Channel.YouTubeChannel, Video.YouTubeVideo],
|
|
61
|
-
services: [Database.Service, Feed.
|
|
61
|
+
services: [Database.Service, Feed.FeedService],
|
|
62
62
|
});
|
package/src/operations/sync.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { log } from '@dxos/log';
|
|
|
16
16
|
import { Operation } from '@dxos/operation';
|
|
17
17
|
|
|
18
18
|
import { Channel, Video } from '../types';
|
|
19
|
-
|
|
20
19
|
import { YouTube } from './apis';
|
|
21
20
|
import { Sync } from './definitions';
|
|
22
21
|
import { GoogleCredentials } from './services/google-credentials';
|