Skip to content

Commit 55fcf77

Browse files
[Word] (Desktop 1.1) Promote snippets from preview (OfficeDev#929)
1 parent a1f3aa8 commit 55fcf77

File tree

13 files changed

+202
-646
lines changed

13 files changed

+202
-646
lines changed

playlists-prod/word.yaml

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/15-images/insert-and-get-pictures.yaml
129129
group: Images
130130
api_set:
131-
WordApi: '1.1'
131+
WordApiDesktop: '1.1'
132132
- id: word-lists-insert-list
133133
name: Create a list
134134
fileName: insert-list.yaml
@@ -138,6 +138,15 @@
138138
group: Lists
139139
api_set:
140140
WordApi: '1.3'
141+
- id: word-lists-manage-styles
142+
name: Get list styles
143+
fileName: manage-list-styles.yaml
144+
description: This sample shows how to get the list styles in the current document.
145+
rawUrl: >-
146+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/20-lists/manage-list-styles.yaml
147+
group: Lists
148+
api_set:
149+
WordApiDesktop: '1.1'
141150
- id: word-lists-organize-list
142151
name: Organize a list
143152
fileName: organize-list.yaml
@@ -330,6 +339,17 @@
330339
group: Tables
331340
api_set:
332341
WordApi: '1.3'
342+
- id: word-tables-manage-custom-style
343+
name: Manage custom table style
344+
fileName: manage-custom-style.yaml
345+
description: >-
346+
Shows how to manage primarily margins and alignments of a custom table style
347+
in the current document.
348+
rawUrl: >-
349+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/40-tables/manage-custom-style.yaml
350+
group: Tables
351+
api_set:
352+
WordApiDesktop: '1.1'
333353
- id: word-document-manage-body
334354
name: Manage body
335355
fileName: manage-body.yaml
@@ -458,7 +478,7 @@
458478
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-styles.yaml
459479
group: Document
460480
api_set:
461-
WordApi: '1.5'
481+
WordApiDesktop: '1.1'
462482
- id: word-document-get-external-styles
463483
name: Get styles from external document
464484
fileName: get-external-styles.yaml
@@ -488,6 +508,15 @@
488508
group: Document
489509
api_set:
490510
WordApi: '1.8'
511+
- id: word-document-compare-documents
512+
name: Compare documents
513+
fileName: compare-documents.yaml
514+
description: Compares two documents (the current one and a specified external one).
515+
rawUrl: >-
516+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/compare-documents.yaml
517+
group: Document
518+
api_set:
519+
WordApiDesktop: '1.1'
491520
- id: word-scenarios-doc-assembly
492521
name: Document assembly
493522
fileName: doc-assembly.yaml
@@ -506,15 +535,6 @@
506535
group: Scenarios
507536
api_set:
508537
WordApi: '1.3'
509-
- id: word-document-compare-documents
510-
name: Compare documents
511-
fileName: compare-documents.yaml
512-
description: Compares two documents (the current one and a specified external one).
513-
rawUrl: >-
514-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/compare-documents.yaml
515-
group: Preview APIs
516-
api_set:
517-
WordApi: '1.9'
518538
- id: word-insert-and-change-combo-box-content-control
519539
name: Manage combo box content controls
520540
fileName: insert-and-change-combo-box-content-control.yaml
@@ -542,24 +562,6 @@
542562
group: Preview APIs
543563
api_set:
544564
WordApi: '1.9'
545-
- id: word-insert-and-get-pictures
546-
name: Use inline pictures
547-
fileName: insert-and-get-pictures.yaml
548-
description: Inserts and gets inline pictures.
549-
rawUrl: >-
550-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/insert-and-get-pictures.yaml
551-
group: Preview APIs
552-
api_set:
553-
WordApi: '1.9'
554-
- id: word-lists-manage-styles
555-
name: Get list styles
556-
fileName: manage-list-styles.yaml
557-
description: This sample shows how to get the list styles in the current document.
558-
rawUrl: >-
559-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-list-styles.yaml
560-
group: Preview APIs
561-
api_set:
562-
WordApi: '1.9'
563565
- id: word-manage-comments
564566
name: Manage comments
565567
fileName: manage-comments.yaml
@@ -569,27 +571,5 @@
569571
rawUrl: >-
570572
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-comments.yaml
571573
group: Preview APIs
572-
api_set:
573-
WordApi: '1.9'
574-
- id: word-manage-styles
575-
name: Manage styles
576-
fileName: manage-styles.yaml
577-
description: >-
578-
This sample shows how to perform operations on the styles in the current
579-
document and how to add and delete custom styles.
580-
rawUrl: >-
581-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-styles.yaml
582-
group: Preview APIs
583-
api_set:
584-
WordApi: '1.9'
585-
- id: word-tables-manage-custom-style
586-
name: Manage custom table style
587-
fileName: manage-custom-style.yaml
588-
description: >-
589-
Shows how to manage primarily margins and alignments of a custom table style
590-
in the current document.
591-
rawUrl: >-
592-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-custom-style.yaml
593-
group: Preview APIs
594574
api_set:
595575
WordApi: '1.9'

playlists/word.yaml

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/15-images/insert-and-get-pictures.yaml
129129
group: Images
130130
api_set:
131-
WordApi: '1.1'
131+
WordApiDesktop: '1.1'
132132
- id: word-lists-insert-list
133133
name: Create a list
134134
fileName: insert-list.yaml
@@ -138,6 +138,15 @@
138138
group: Lists
139139
api_set:
140140
WordApi: '1.3'
141+
- id: word-lists-manage-styles
142+
name: Get list styles
143+
fileName: manage-list-styles.yaml
144+
description: This sample shows how to get the list styles in the current document.
145+
rawUrl: >-
146+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/20-lists/manage-list-styles.yaml
147+
group: Lists
148+
api_set:
149+
WordApiDesktop: '1.1'
141150
- id: word-lists-organize-list
142151
name: Organize a list
143152
fileName: organize-list.yaml
@@ -330,6 +339,17 @@
330339
group: Tables
331340
api_set:
332341
WordApi: '1.3'
342+
- id: word-tables-manage-custom-style
343+
name: Manage custom table style
344+
fileName: manage-custom-style.yaml
345+
description: >-
346+
Shows how to manage primarily margins and alignments of a custom table style
347+
in the current document.
348+
rawUrl: >-
349+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/40-tables/manage-custom-style.yaml
350+
group: Tables
351+
api_set:
352+
WordApiDesktop: '1.1'
333353
- id: word-document-manage-body
334354
name: Manage body
335355
fileName: manage-body.yaml
@@ -458,7 +478,7 @@
458478
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/50-document/manage-styles.yaml
459479
group: Document
460480
api_set:
461-
WordApi: '1.5'
481+
WordApiDesktop: '1.1'
462482
- id: word-document-get-external-styles
463483
name: Get styles from external document
464484
fileName: get-external-styles.yaml
@@ -488,6 +508,15 @@
488508
group: Document
489509
api_set:
490510
WordApi: '1.8'
511+
- id: word-document-compare-documents
512+
name: Compare documents
513+
fileName: compare-documents.yaml
514+
description: Compares two documents (the current one and a specified external one).
515+
rawUrl: >-
516+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/50-document/compare-documents.yaml
517+
group: Document
518+
api_set:
519+
WordApiDesktop: '1.1'
491520
- id: word-scenarios-doc-assembly
492521
name: Document assembly
493522
fileName: doc-assembly.yaml
@@ -506,15 +535,6 @@
506535
group: Scenarios
507536
api_set:
508537
WordApi: '1.3'
509-
- id: word-document-compare-documents
510-
name: Compare documents
511-
fileName: compare-documents.yaml
512-
description: Compares two documents (the current one and a specified external one).
513-
rawUrl: >-
514-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/compare-documents.yaml
515-
group: Preview APIs
516-
api_set:
517-
WordApi: '1.9'
518538
- id: word-insert-and-change-combo-box-content-control
519539
name: Manage combo box content controls
520540
fileName: insert-and-change-combo-box-content-control.yaml
@@ -542,24 +562,6 @@
542562
group: Preview APIs
543563
api_set:
544564
WordApi: '1.9'
545-
- id: word-insert-and-get-pictures
546-
name: Use inline pictures
547-
fileName: insert-and-get-pictures.yaml
548-
description: Inserts and gets inline pictures.
549-
rawUrl: >-
550-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/insert-and-get-pictures.yaml
551-
group: Preview APIs
552-
api_set:
553-
WordApi: '1.9'
554-
- id: word-lists-manage-styles
555-
name: Get list styles
556-
fileName: manage-list-styles.yaml
557-
description: This sample shows how to get the list styles in the current document.
558-
rawUrl: >-
559-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/manage-list-styles.yaml
560-
group: Preview APIs
561-
api_set:
562-
WordApi: '1.9'
563565
- id: word-manage-comments
564566
name: Manage comments
565567
fileName: manage-comments.yaml
@@ -571,25 +573,3 @@
571573
group: Preview APIs
572574
api_set:
573575
WordApi: '1.9'
574-
- id: word-manage-styles
575-
name: Manage styles
576-
fileName: manage-styles.yaml
577-
description: >-
578-
This sample shows how to perform operations on the styles in the current
579-
document and how to add and delete custom styles.
580-
rawUrl: >-
581-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/manage-styles.yaml
582-
group: Preview APIs
583-
api_set:
584-
WordApi: '1.9'
585-
- id: word-tables-manage-custom-style
586-
name: Manage custom table style
587-
fileName: manage-custom-style.yaml
588-
description: >-
589-
Shows how to manage primarily margins and alignments of a custom table style
590-
in the current document.
591-
rawUrl: >-
592-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/manage-custom-style.yaml
593-
group: Preview APIs
594-
api_set:
595-
WordApi: '1.9'

samples/word/15-images/insert-and-get-pictures.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ order: 1
22
id: word-images-insert-and-get-pictures
33
name: Use inline pictures
44
description: Inserts and gets inline pictures.
5-
author: OfficeDev
65
host: WORD
76
api_set:
8-
WordApi: '1.1'
7+
WordApiDesktop: '1.1'
98
script:
109
content: |
1110
$("#setup").on("click", () => tryCatch(setup));
@@ -28,10 +27,10 @@ script:
2827
// Gets the first image in the document.
2928
await Word.run(async (context) => {
3029
const firstPicture: Word.InlinePicture = context.document.body.inlinePictures.getFirst();
31-
firstPicture.load("width, height");
30+
firstPicture.load("width, height, imageFormat");
3231
3332
await context.sync();
34-
console.log(`Image dimensions: ${firstPicture.width} x ${firstPicture.height}`);
33+
console.log(`Image dimensions: ${firstPicture.width} x ${firstPicture.height}`, `Image format: ${firstPicture.imageFormat}`);
3534
// Get the image encoded as Base64.
3635
const base64 = firstPicture.getBase64ImageSrc();
3736

samples/word/99-preview-apis/manage-list-styles.yaml renamed to samples/word/20-lists/manage-list-styles.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
order: 2
12
id: word-lists-manage-styles
23
name: Get list styles
34
description: This sample shows how to get the list styles in the current document.
45
author: xiruatms
56
host: WORD
67
api_set:
7-
WordApi: '1.9'
8+
WordApiDesktop: '1.1'
89
script:
910
content: |
1011
$("#count").on("click", () => tryCatch(getCount));
@@ -105,8 +106,8 @@ style:
105106
}
106107
language: css
107108
libraries: |-
108-
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
109-
@types/office-js-preview
109+
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
110+
@types/office-js
110111
[email protected]/dist/css/fabric.min.css
111112
[email protected]/dist/css/fabric.components.min.css
112113
[email protected]/client/core.min.js

samples/word/99-preview-apis/manage-custom-style.yaml renamed to samples/word/40-tables/manage-custom-style.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
order: 3
12
id: word-tables-manage-custom-style
23
name: Manage custom table style
34
description: Shows how to manage primarily margins and alignments of a custom table style in the current document.
4-
author: OfficeDev
55
host: WORD
66
api_set:
7-
WordApi: '1.9'
7+
WordApiDesktop: '1.1'
88
script:
99
content: |
1010
$("#add-style").on("click", () => tryCatch(addStyle));
@@ -472,8 +472,8 @@ style:
472472
}
473473
language: css
474474
libraries: |
475-
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
476-
@types/office-js-preview
475+
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
476+
@types/office-js
477477
478478
[email protected]/dist/css/fabric.min.css
479479
[email protected]/dist/css/fabric.components.min.css

samples/word/99-preview-apis/compare-documents.yaml renamed to samples/word/50-document/compare-documents.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
order: 16
12
id: word-document-compare-documents
23
name: Compare documents
34
description: Compares two documents (the current one and a specified external one).
45
author: YijunMS
56
host: WORD
67
api_set:
7-
WordApi: '1.9'
8+
WordApiDesktop: '1.1'
89
script:
910
content: |
1011
$("#run").on("click", () => tryCatch(run));
@@ -69,8 +70,8 @@ style:
6970
}
7071
language: css
7172
libraries: |
72-
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
73-
@types/office-js-preview
73+
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
74+
@types/office-js
7475
7576
[email protected]/dist/css/fabric.min.css
7677
[email protected]/dist/css/fabric.components.min.css

0 commit comments

Comments
 (0)