Skip to content

Commit

Permalink
Merge branch 'feature/11ty-format' of https://github.com/ONLYOFFICE/a…
Browse files Browse the repository at this point in the history
…pi.onlyoffice.com into feature/11ty-format
  • Loading branch information
Serg-Kv committed Jul 25, 2024
2 parents 4af9e23 + d81b728 commit 39325f6
Show file tree
Hide file tree
Showing 41 changed files with 993 additions and 410 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Publish

on:
workflow_dispatch:
inputs:
site_mode:
description: Site mode can be either "production", "testing" or "development".
required: true
default: testing

jobs:
publish:
Expand All @@ -22,14 +27,25 @@ jobs:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_KEY }}
aws-region: us-east-1

- name: Build Packages
run: pnpm build

- name: Build Site
timeout-minutes: 60
working-directory: site
run: /usr/bin/time --verbose pnpm build
run: |
m="${{github.event.inputs.site_mode}}"
if [ "$m" = "production" ]; then
/usr/bin/time --verbose pnpm build:prod
elif [ "$m" = "testing" ]; then
/usr/bin/time --verbose pnpm build:test
elif [ "$m" = "development" ]; then
/usr/bin/time --verbose pnpm build:dev
else
echo "Invalid site mode: $m"
exit 1
fi
- name: Sync bucket
run: |
Expand All @@ -38,4 +54,3 @@ jobs:
- name: Invalidate CLOUDFRONT cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths '/*'

2 changes: 1 addition & 1 deletion packages/combobox-container-html-element/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
box-sizing: border-box;
margin-top: 0.4em;
max-height: 10.5em;
overflow-y: scroll;
overflow-y: auto;
position: absolute;
width: 100%;
z-index: 1;
Expand Down
2 changes: 1 addition & 1 deletion packages/document-server-types/lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ export interface DocEditorConfigEditorConfigCustomization {
/**
* {@link https://api.onlyoffice.com/editors/config/editor/customization#logo ONLYOFFICE Reference}
*/
logo: DocEditorConfigEditorConfigCustomizationLogo
logo?: DocEditorConfigEditorConfigCustomizationLogo

/**
* {@link https://api.onlyoffice.com/editors/config/editor/customization#macros ONLYOFFICE Reference}
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi-declaration/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export class ProcessPath extends Transform {
} else {
const u = m.toUpperCase()
s.tags.forEach((t) => {
const a = t.split("/")
const a = t.split("/").map((s) => s.trim())
a.forEach((t, i) => {
// todo: support overloading, ex portal and Portal.
// temp solution
const g = a.slice(0, i + 1).join("/")
const s = g.split("/").map(slug).join("/")
const s = g.split("/").map((v) => slug(v)).join("/")
let ct = this._cache.groups[s]
if (ct === undefined) {
ct = {
Expand Down Expand Up @@ -230,7 +230,7 @@ function populateRequestHero(req: REST.RequestDeclaration, m: string, p: string,
if (s.tags !== undefined) {
const [t] = s.tags
if (t !== undefined) {
a = t.split("/")
a = t.split("/").map((s) => s.trim())
} else {
console.warn("first tag is missing")
}
Expand Down
16 changes: 8 additions & 8 deletions packages/remark-document-builder/lib/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test("does nothing if no option is specified", async () => {
})

test("does nothing if no language is specified", async () => {
const c = "``` use-document-builder\n\n```"
const c = "``` document-builder\n\n```"
const f = await unified()
.use(remarkParse)
.use(remarkDocumentBuilder)
Expand All @@ -33,18 +33,18 @@ test("does nothing if no language is specified", async () => {
})

test("does not exposes the data property if not language is specified", async () => {
const c = "``` use-document-builder\n\n```"
const c = "``` document-builder\n\n```"
const f = await unified()
.use(remarkParse)
.use(remarkDocumentBuilder)
.use(remarkRehype)
.use(rehypeStringify)
.process(c)
is(f.value, '<pre><code class="language-use-document-builder"></code></pre>')
is(f.value, '<pre><code class="language-document-builder"></code></pre>')
})

test("populates hProperties if a language is specified", async () => {
const c = "```js use-document-builder\n\n```"
const c = "```js document-builder\n\n```"
const f = await unified()
.use(remarkParse)
.use(remarkDocumentBuilder)
Expand All @@ -66,11 +66,11 @@ test("populates hProperties if a language is specified", async () => {
return
}

is(p.dataUseDocumentBuilder, true)
is(p.dataDocumentBuilder, "true")
})

test("does not overrides hProperties if they already exist", async () => {
const c = "```js use-document-builder\n\n```"
const c = "```js document-builder\n\n```"
const f = await unified()
.use(remarkParse)
.use(() => {
Expand Down Expand Up @@ -103,14 +103,14 @@ test("does not overrides hProperties if they already exist", async () => {
})

test("exposes the data property if a language is specified", async () => {
const c = "```js use-document-builder\n\n```"
const c = "```js document-builder\n\n```"
const f = await unified()
.use(remarkParse)
.use(remarkDocumentBuilder)
.use(remarkRehype)
.use(rehypeStringify)
.process(c)
is(f.value, '<pre><code class="language-js" data-use-document-builder></code></pre>')
is(f.value, '<pre><code class="language-js" data-document-builder></code></pre>')
})

test.run()
Expand Down
6 changes: 3 additions & 3 deletions packages/remark-document-builder/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {visit} from "unist-util-visit"

declare module "hast" {
interface Properties {
dataUseDocumentBuilder?: boolean
dataDocumentBuilder?: string
}
}

Expand All @@ -20,7 +20,7 @@ export function remarkDocumentBuilder(): Transform {

let has = false
for (const el of node.meta.split(" ")) {
if (el === "use-document-builder") {
if (el === "document-builder") {
has = true
break
}
Expand All @@ -42,7 +42,7 @@ export function remarkDocumentBuilder(): Transform {
d.hProperties = p
}

p.dataUseDocumentBuilder = true
p.dataDocumentBuilder = "true"
})
}
}
13 changes: 13 additions & 0 deletions packages/site-config/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import yaml from "yaml"

export interface InputConfig {
baseUrl?: string
analytics?: boolean
server?: InputServer
playground?: InputPlayground
}

export interface Configurable {
baseUrl: string
analytics: boolean
server: ServerConfigurable
playground: PlaygroundConfigurable
}
Expand All @@ -19,6 +21,7 @@ export class Config implements Configurable {
static shared: Configurable

baseUrl = ""
analytics = false
server = new ServerConfig()
playground = new PlaygroundConfig()

Expand Down Expand Up @@ -82,6 +85,10 @@ export class Config implements Configurable {
co.baseUrl = ic.baseUrl
}

if (ic.analytics !== undefined) {
co.analytics = ic.analytics
}

if (ic.server) {
co.server = ServerConfig.fromInput(ic.server)
}
Expand All @@ -102,6 +109,12 @@ export class Config implements Configurable {
co.baseUrl = a.baseUrl
}

if (b.analytics !== undefined) {
co.analytics = b.analytics
} else if (a.analytics !== undefined) {
co.analytics = a.analytics
}

co.server = ServerConfig.merge(a.server, b.server)
co.playground = PlaygroundConfig.merge(a.playground, b.playground)

Expand Down
39 changes: 21 additions & 18 deletions packages/site-document-editor-playground/lib/main.css
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
.de-playground {
background-color: var(--color-background-muted);
padding-bottom: 140px;
padding-top: 32px;
padding-top: var(--base-size-32);
}

.de-playground__inner {
box-sizing: border-box;
display: flex;
flex-direction: column;
margin: 0 auto;
max-width: 1440px;
padding-left: 24px;
padding-right: 24px;
padding-left: var(--base-size-24);
padding-right: var(--base-size-24);
width: 100%;
}

.de-playground__heading {
font-size: 32px;
font-weight: 700;
line-height: 1.25;
margin-bottom: 32px;
margin-top: 22px;
font-size: var(--text-display-font-size-default);
font-weight: var(--text-display-font-weight-default);
line-height: var(--text-display-line-height-default);
margin-bottom: var(--base-size-32);
margin-top: var(--base-size-24);
}

.de-playground__islands {
display: grid;
grid-gap: 16px;
grid-gap: var(--base-size-16);
grid-template-columns: repeat(11, 1fr);
grid-template-rows: 1fr min-content min-content min-content min-content;
}

.de-playground__island {
background-color: var(--color-background-default);
border-radius: 4px;
border: 1px solid var(--color-scale-gray-5);
padding: 12px;
border-color: var(--color-border-muted);
border-radius: var(--size-border-radius-small);
border-style: solid;
border-width: var(--size-border-width-thin);
padding: var(--base-size-12);
}

.de-playground__scenarios {
Expand Down Expand Up @@ -67,23 +70,23 @@
}

.de-playground__container {
margin-top: 18px;
margin-top: var(--base-size-20);
}

.de-playground__container:empty {
margin-top: 0;
}

.de-playground__function-property {
margin-top: 18px;
margin-top: var(--base-size-20);
}

.de-playground__function-property:first-of-type {
margin-top: 0;
}

.de-playground__function-property output pre {
margin-top: 9px;
margin-top: var(--base-size-8);
}

.de-playground document-editor-playground {
Expand All @@ -96,22 +99,22 @@
}

.de-playground document-editor {
border-radius: 3px;
border-radius: var(--size-border-radius-small);
display: block;
height: inherit;
overflow: hidden;
}

.de-playground .form-control {
margin-top: 18px;
margin-top: var(--base-size-20);
}

.de-playground .form-control:first-of-type {
margin-top: 0;
}

.de-playground .form-control__label a {
color: var(--color-foreground-anchor);
color: var(--color-foreground-link);
}

.de-playground .form-control__label a:focus-visible,
Expand Down
2 changes: 1 addition & 1 deletion packages/site-page/lib/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@

.page .chapter__navigation {
max-height: calc(100vh - var(--page-header-content-height));
overflow-y: scroll;
overflow-y: auto;
position: sticky;
top: var(--page-header-content-height);
}
2 changes: 1 addition & 1 deletion packages/ui-code-editor/lib/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
margin-top: 0;
min-height: var(--code-editor-min-height);
min-width: 100%;
overflow: scroll;
overflow: auto;
padding: var(--base-size-12) var(--base-size-16);
tab-size: 2;
white-space: nowrap;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-content/lib/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
grid-template-columns: var(--base-size-16) 1fr var(--base-size-16);
margin-bottom: 0;
margin-top: var(--base-size-20);
overflow: scroll;
overflow: auto;
padding-bottom: var(--base-size-12);
padding-top: var(--base-size-12);
tab-size: 2;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-select/lib/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
border-width: var(--size-border-width-thin);
color: var(--color-control-default-foreground-active);
max-height: var(--select-listbox-max-height);
overflow-y: scroll;
overflow-y: auto;
padding-bottom: var(--base-size-8);
padding-top: var(--base-size-8);
position: absolute;
Expand Down
8 changes: 6 additions & 2 deletions site/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ table {
width: auto !important;
}

/* todo: temp solution */
document-builder {
.content document-builder-container {
display: block;
margin-top: var(--base-size-20);
}

.content document-builder {
display: block;
height: 550px;
}
6 changes: 6 additions & 0 deletions site/assets/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ function main(): void {
sp.client = c
sp.play()
}

const bc = document.querySelector("document-builder-container")
if (bc) {
bc.client = c
bc.play()
}
}

function onError(...args: unknown[]): void {
Expand Down
Loading

0 comments on commit 39325f6

Please sign in to comment.