@streamscloud/embeddable 2.8.1 → 2.9.0

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.
@@ -1,4 +1,3 @@
1
1
  export declare const createLocalGQLClient: (graphqlOrigin?: string, customFetch?: typeof fetch) => import("@urql/core").Client;
2
2
  export declare const resolveGraphQLOrigin: (origin?: string) => string;
3
- export declare const constructCoreGraphQLUrl: (graphqlOrigin?: string) => string;
4
- export declare const constructExternalGraphQLUrl: (graphqlOrigin?: string) => string;
3
+ export declare const constructGraphQLUrl: (graphqlOrigin?: string) => string;
@@ -1,6 +1,6 @@
1
1
  import { createClient, fetchExchange } from '@urql/core';
2
2
  export const createLocalGQLClient = (graphqlOrigin, customFetch) => createClient({
3
- url: constructCoreGraphQLUrl(resolveGraphQLOrigin(graphqlOrigin)),
3
+ url: constructGraphQLUrl(resolveGraphQLOrigin(graphqlOrigin)),
4
4
  requestPolicy: 'network-only',
5
5
  fetchOptions: {
6
6
  credentials: 'include'
@@ -11,12 +11,7 @@ export const createLocalGQLClient = (graphqlOrigin, customFetch) => createClient
11
11
  export const resolveGraphQLOrigin = (origin) => {
12
12
  return origin || 'https://api.streamscloud.com';
13
13
  };
14
- export const constructCoreGraphQLUrl = (graphqlOrigin) => {
15
- let baseUrl = resolveGraphQLOrigin(graphqlOrigin);
16
- baseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
17
- return `${baseUrl}graphql`;
18
- };
19
- export const constructExternalGraphQLUrl = (graphqlOrigin) => {
14
+ export const constructGraphQLUrl = (graphqlOrigin) => {
20
15
  let baseUrl = resolveGraphQLOrigin(graphqlOrigin);
21
16
  baseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
22
17
  return `${baseUrl}external/graphql`;
@@ -1,6 +1,6 @@
1
1
  import { isLocale } from '../../core/locale';
2
2
  export class ShortVideoProductLocalization {
3
- beforeNowPrefix = $state('Before');
3
+ beforeNowPrefix;
4
4
  constructor(init) {
5
5
  this.beforeNowPrefix = isLocale(init) ? loc.beforeNowPrefix[init] : init?.beforeNowPrefix || loc.beforeNowPrefix.en;
6
6
  }
@@ -40,7 +40,7 @@ const initBuffer = (input) => __awaiter(void 0, void 0, void 0, function* () {
40
40
  .query(GetShortVideosDocument, {
41
41
  input: {
42
42
  filter: {
43
- includePostIds: ids
43
+ ids
44
44
  }
45
45
  }
46
46
  })
@@ -1,7 +1,7 @@
1
1
  import type * as SchemaTypes from '../../../gql/types';
2
2
  import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
3
3
  export type GetShortVideosQueryVariables = SchemaTypes.Exact<{
4
- input: SchemaTypes.PostsInput;
4
+ input: SchemaTypes.EmbedPostsInput;
5
5
  image_scale?: SchemaTypes.InputMaybe<SchemaTypes.ImageScale>;
6
6
  }>;
7
7
  export type GetShortVideosQuery = {
@@ -9,7 +9,7 @@ export const GetShortVideosDocument = {
9
9
  {
10
10
  kind: 'VariableDefinition',
11
11
  variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
12
- type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'PostsInput' } } }
12
+ type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'EmbedPostsInput' } } }
13
13
  },
14
14
  {
15
15
  kind: 'VariableDefinition',
@@ -24,7 +24,7 @@ export const GetShortVideosDocument = {
24
24
  {
25
25
  kind: 'Field',
26
26
  alias: { kind: 'Name', value: 'shortVideos' },
27
- name: { kind: 'Name', value: 'posts' },
27
+ name: { kind: 'Name', value: 'embedPosts' },
28
28
  arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'input' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } } }],
29
29
  selectionSet: {
30
30
  kind: 'SelectionSet',
@@ -1,6 +1,6 @@
1
1
  # noinspection GraphQLSchemaValidation
2
- query GetShortVideos($input: PostsInput!, $image_scale: ImageScale = ORIGINAL_ENCODED) {
3
- shortVideos: posts(input: $input) {
2
+ query GetShortVideos($input: EmbedPostsInput!, $image_scale: ImageScale = ORIGINAL_ENCODED) {
3
+ shortVideos: embedPosts(input: $input) {
4
4
  items {
5
5
  ...ShortVideoViewerPayloadFragment
6
6
  }
@@ -2,5 +2,5 @@ export const isShortVideosProviderInit = (init) => {
2
2
  return typeof init === 'object' && init !== null && 'shortVideosProvider' in init;
3
3
  };
4
4
  export function isIdsInit(init) {
5
- return typeof init === 'object' && init !== null && 'ids' in init && 'graphqlUrl' in init;
5
+ return typeof init === 'object' && init !== null && 'ids' in init && 'graphqlOrigin' in init;
6
6
  }
@@ -9,7 +9,7 @@
9
9
  };
10
10
  import { getOrCreateProfileId } from '../../core/analytics.profile-id';
11
11
  import { handleEsc } from '../../core/document.event-handlers';
12
- import { constructExternalGraphQLUrl, createLocalGQLClient } from '../../core/graphql';
12
+ import { constructGraphQLUrl, createLocalGQLClient } from '../../core/graphql';
13
13
  import { toastrWarning } from '../../core/toastr';
14
14
  import { ShortVideoViewer } from '../../short-videos/short-video-viewer';
15
15
  import { mapToShortVideoViewerModel } from '../layout/models';
@@ -63,7 +63,7 @@ onMount(() => __awaiter(void 0, void 0, void 0, function* () {
63
63
  (_b = on === null || on === void 0 ? void 0 : on.closePlayer) === null || _b === void 0 ? void 0 : _b.call(on);
64
64
  return;
65
65
  }
66
- AppEventsTracker.setEndpoint(constructExternalGraphQLUrl(graphqlOrigin));
66
+ AppEventsTracker.setEndpoint(constructGraphQLUrl(graphqlOrigin));
67
67
  AppEventsTracker.setProfileId(getOrCreateProfileId());
68
68
  (_c = on === null || on === void 0 ? void 0 : on.streamActivated) === null || _c === void 0 ? void 0 : _c.call(on, {
69
69
  ownerId: streamPayload.data.stream.ownerProfile.id,
@@ -27,7 +27,7 @@ export type GetStreamQuery = {
27
27
  } | null;
28
28
  };
29
29
  export type GetStreamPagesQueryVariables = SchemaTypes.Exact<{
30
- input: SchemaTypes.StreamPagesInput;
30
+ input: SchemaTypes.EmbedStreamPagesInput;
31
31
  image_scale: SchemaTypes.ImageScale;
32
32
  }>;
33
33
  export type GetStreamPagesQuery = {
@@ -67,7 +67,8 @@ export const GetStreamDocument = {
67
67
  selections: [
68
68
  {
69
69
  kind: 'Field',
70
- name: { kind: 'Name', value: 'stream' },
70
+ alias: { kind: 'Name', value: 'stream' },
71
+ name: { kind: 'Name', value: 'embedStream' },
71
72
  arguments: [
72
73
  {
73
74
  kind: 'Argument',
@@ -141,7 +142,7 @@ export const GetStreamPagesDocument = {
141
142
  {
142
143
  kind: 'VariableDefinition',
143
144
  variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
144
- type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'StreamPagesInput' } } }
145
+ type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'EmbedStreamPagesInput' } } }
145
146
  },
146
147
  {
147
148
  kind: 'VariableDefinition',
@@ -154,7 +155,8 @@ export const GetStreamPagesDocument = {
154
155
  selections: [
155
156
  {
156
157
  kind: 'Field',
157
- name: { kind: 'Name', value: 'streamPages' },
158
+ alias: { kind: 'Name', value: 'streamPages' },
159
+ name: { kind: 'Name', value: 'embedStreamPages' },
158
160
  arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'input' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } } }],
159
161
  selectionSet: {
160
162
  kind: 'SelectionSet',
@@ -1,12 +1,12 @@
1
1
  query GetStream($id: String!) {
2
- stream(input: { id: $id }) {
2
+ stream:embedStream(input: { id: $id }) {
3
3
  ...StreamPlayerPayloadFragment
4
4
  }
5
5
  }
6
6
 
7
7
  # noinspection GraphQLSchemaValidation
8
- query GetStreamPages($input: StreamPagesInput!, $image_scale: ImageScale!) {
9
- streamPages(input: $input) {
8
+ query GetStreamPages($input: EmbedStreamPagesInput!, $image_scale: ImageScale!) {
9
+ streamPages:embedStreamPages(input: $input) {
10
10
  items {
11
11
  ...StreamPageViewerPayloadFragment
12
12
  }
@@ -23,7 +23,7 @@ export class StreamPlayerBuffer {
23
23
  const payload = await graphql
24
24
  .query(GetStreamPagesDocument, {
25
25
  input: {
26
- limit: 10,
26
+ limit: 2,
27
27
  continuationToken,
28
28
  filter: {
29
29
  streamId
@@ -70,7 +70,7 @@ export class StreamPlayerBuffer {
70
70
  this._pagesLoader.reset();
71
71
  };
72
72
  warmUpBuffer = async () => {
73
- const bufferSize = 5;
73
+ const bufferSize = 2;
74
74
  if (this.loaded.length >= this.currentIndex + bufferSize) {
75
75
  return;
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": "https://github.com/StreamsCloud/streamscloud-frontend-packages.git",
6
6
  "type": "module",
@@ -97,7 +97,7 @@
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@fluentui/svg-icons": "^1.1.292",
100
- "@streamscloud/streams-analytics-collector": "latest",
100
+ "@streamscloud/streams-analytics-collector": "^2.0.1",
101
101
  "@urql/core": "^5.1.1",
102
102
  "dompurify": "^3.2.6",
103
103
  "mobile-detect": "^1.4.5",