Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ms-word-addin): multi-profile and templates in MS Word Addin #125

Merged
merged 80 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d2dee1d
feat(ms-word-addin): create a temporary copy of ms-word-addin folder
panzerdp Jan 24, 2023
bd95314
chore(ms-word-addin): set package new of the ms adding copy
panzerdp Jan 24, 2023
db1345d
feat(ms-word-addin) Copy extension file to new addin
panzerdp Jan 26, 2023
e52b5c0
Merge branch 'master' into feature/word-multi-profile
panzerdp Feb 2, 2023
0ab0df6
Merge branch 'master' into feature/word-multi-profile
panzerdp Feb 2, 2023
91597db
refactor(ms-word-addin): remove the old copy
panzerdp Feb 2, 2023
1e45b3c
feat(ms-word-addin): new ms word addin
panzerdp Feb 2, 2023
a63bc73
feat(ms-word-addin): remove chrome specific from ms word addin new
panzerdp Feb 3, 2023
befd070
feat(ms-word-addin): migrate readme, update tsconfig, include the man…
panzerdp Feb 3, 2023
6ea8fb4
chore: remove no-hoist option from apps
panzerdp Feb 3, 2023
a99db7b
chore(ms-word-addin): udpate default server port in manifest to match…
panzerdp Feb 3, 2023
4556b28
chore(ms-word-addin): set certs for vite dev server
panzerdp Feb 3, 2023
c30215a
chore(ms-word-addin): configure vite to copy manifest.xml with produc…
panzerdp Feb 3, 2023
2988f7c
chore(ms-word-addin): use port 3000 as the deve server
panzerdp Feb 3, 2023
9b9a566
chore(ms-word-addin): remove index.html from public folder, restore m…
panzerdp Feb 3, 2023
5c05deb
Merge branch 'master' into feature/word-multi-profile
panzerdp Feb 6, 2023
445b36b
Merge remote-tracking branch 'origin' into feature/word-multi-profile
panzerdp Feb 6, 2023
f2fefe3
chore(ms-word-addin): bypass chrome var
panzerdp Feb 6, 2023
ae66312
feat(ms-word-addin): remove background and content scripts
panzerdp Feb 6, 2023
8c19cc6
Merge remote-tracking branch 'origin' into feature/word-multi-profile
panzerdp Feb 6, 2023
92f91cd
feat(ms-word-addin): remove quick activate
panzerdp Feb 6, 2023
3638e63
feat(ms-word-addin): remove enable/disable
panzerdp Feb 6, 2023
e117082
style(ms-word-addin): main menu layout and buttons
panzerdp Feb 6, 2023
4787e7b
feat(ms-word-addin): main menu buttons
panzerdp Feb 6, 2023
999bbf4
fix(ms-word-addin): fix bottom links in main menu
panzerdp Feb 7, 2023
fd63a6f
feat(ms-word-addin): initial message when no profile has been created
panzerdp Feb 7, 2023
4b3347f
style(ms-word-addin): update main menu width
panzerdp Feb 7, 2023
1d94e8a
style(ms-word-addin): phonemes and letters settings in options page
panzerdp Feb 7, 2023
e3c2954
style(ms-word-addin): phonemes and letters settings in options page
panzerdp Feb 7, 2023
90d5b23
style(ms-word-addin): table header of settings
panzerdp Feb 7, 2023
a262c58
style(ms-word-addin): general settings styles in progress
panzerdp Feb 7, 2023
ffa4346
style(ms-word-addin): options page tables size
panzerdp Feb 7, 2023
7f05006
style(ms-word-addin): general settings styles done
panzerdp Feb 7, 2023
98ab74c
style(ms-word-addin): move language selection to the top
panzerdp Feb 7, 2023
8bad205
style(ms-word-addin): smaller language selection link
panzerdp Feb 7, 2023
8329e8e
style(ms-word-addin): settings form layout
panzerdp Feb 7, 2023
c6dfc5f
style(ms-word-addin): 1 template per row
panzerdp Feb 7, 2023
f81ba7e
style(ms-word-addin): settings table header adjustements
panzerdp Feb 7, 2023
5018e36
feat(ms-word-addin): add back buttons
panzerdp Feb 7, 2023
c723c87
feat(ms-word-addin): move textual information below text in initial s…
panzerdp Feb 7, 2023
35c522f
feat(ms-word-addin): back should go to main screen
panzerdp Feb 7, 2023
cfafc6b
feat(ms-word-addin): connect msoffice scripts
panzerdp Feb 7, 2023
d55581b
feat(ms-word-addin): fix vue router conflict with msoffice API script
panzerdp Feb 7, 2023
ebaa0bd
style(ms-word-addin): new color for secondary buttons
panzerdp Feb 8, 2023
8eeb743
style(ms-word-addin): new color for secondary buttons
panzerdp Feb 8, 2023
3898261
style(ms-word-addin): new color for secondary buttons
panzerdp Feb 8, 2023
6be0152
style(ms-word-addin): make adapt buttons as accent style
panzerdp Feb 8, 2023
f4968ea
feat(ms-word-addin): implemented confirm
panzerdp Feb 8, 2023
630217d
feat(ms-word-addin): dialog box
panzerdp Feb 8, 2023
24723ce
feat(ms-word-addin): prompt
panzerdp Feb 8, 2023
0af1011
feat(ms-word-addin): prompt, alert and confirm working
panzerdp Feb 8, 2023
f635356
refactor(ms-word-addin): remove not needed components
panzerdp Feb 9, 2023
985eb24
feat(ms-word-addin): text settings adapt buttons module
panzerdp Feb 9, 2023
17217eb
feat(ms-word-addin): dialog box migration, in progress
panzerdp Feb 9, 2023
d4540df
feat(ms-word-addin): adapted content page, in progress
panzerdp Feb 9, 2023
dbe051a
fix(ms-word-addin): fix msoffice script breaking vue-router
panzerdp Feb 9, 2023
d40f83e
chore(ms-word-addin): update note about workaround
panzerdp Feb 9, 2023
54921c1
feat(ms-word-addin): open adapted window
panzerdp Feb 9, 2023
e84224e
feat(ms-word-addin): adapt page, half working
panzerdp Feb 9, 2023
f6c2981
fix(ms-word-addin): use solely local storage in ms word addin
panzerdp Feb 9, 2023
f66d372
fix(ms-word-addin): handle the case when no profile is returned by id
panzerdp Feb 9, 2023
ffc71d6
fix(ms-word-addin): fix label in the form
panzerdp Feb 9, 2023
ba0db28
fix(ms-word-addin): fix matomo URL
panzerdp Feb 9, 2023
e54bec5
style(ms-word-addin): fix group space
panzerdp Feb 9, 2023
0dc05a5
feat(ms-word-addin): reading tools form WIP
panzerdp Feb 9, 2023
4cb78fe
feat(ms-word-addin): ruler and mask settings modal
panzerdp Feb 9, 2023
3b4235c
feat(ms-word-addin): print button
panzerdp Feb 9, 2023
9d4e3cb
feat(ms-word-addin): mask and ruler toggles
panzerdp Feb 9, 2023
ea05c79
feat(ms-word-addin): ruler working
panzerdp Feb 9, 2023
ea04187
feat(ms-word-addin): mask and image warning working
panzerdp Feb 10, 2023
60fd775
feat(ms-word-addin): dismissable floating image alert
panzerdp Feb 10, 2023
b557e04
chore(ms-word-addin): rename ms-word-addin-new to ms-word-addin
panzerdp Feb 10, 2023
2941415
chore(ms-word-addin): assets
panzerdp Feb 10, 2023
a4e53a9
chore(ms-word-addin): fix build
panzerdp Feb 10, 2023
c56ff64
feat(ms-word-addin): mask working
panzerdp Feb 10, 2023
92c7752
fix(ms-word-addin): fix the adapt page top bar z-index
panzerdp Feb 10, 2023
bc25212
feat(ms-word-addin): print button location
panzerdp Feb 10, 2023
a17c6e5
chore(ms-word-addin): include unit tests into type check
panzerdp Feb 10, 2023
dc907f0
test(ms-word-addin): mock alert, prompt, and confirm
panzerdp Feb 10, 2023
b6381c3
chore(ms-word-addin): include certs only in dev mode
panzerdp Feb 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/chrome-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/**/*.json", "vite.config.*", "vitest.config.*", "package.json"],
"exclude": ["src/**/*.spec.ts"],
"compilerOptions": {
"baseUrl": ".",
"lib": [
Expand Down
4 changes: 0 additions & 4 deletions apps/ms-word-addin/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
last 2 Chrome versions
last 2 Firefox versions
last 2 Safari version
last 2 Edge versions
Edge 18
33 changes: 16 additions & 17 deletions apps/ms-word-addin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/* eslint-env node */

module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/typescript/recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2020
},
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'plugin:tailwindcss/recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
},
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
env: {
jest: true
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: false
}
}
]
]
}
}
5 changes: 3 additions & 2 deletions apps/ms-word-addin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
node_modules
/dist


# local env files
.env.local
.env.*.local
Expand All @@ -15,9 +14,11 @@ pnpm-debug.log*

# Editor directories and files
.idea
.vscode
.vscode/*.json
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

!.vscode/extensions.json
8 changes: 8 additions & 0 deletions apps/ms-word-addin/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"vue.volar",
"vue.vscode-typescript-vue-plugin",
"bradlc.vscode-tailwindcss"
]
}
4 changes: 2 additions & 2 deletions apps/ms-word-addin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Introduction

Created by [Contentsquare Foundation](https://contentsquare-foundation.org/), Readapt is a software platform that aims to help those with reading challenges like dyslexia to more easily read digital text. The [Microsoft Word version](https://appsource.microsoft.com/en-us/product/office/WA200004098?tab=Overview) of Readapt allows users to set their reading preferences and see an adaptation of the Word document's text. It also provides reading tools like a screen mask and reading ruler.
Created by [Contentsquare Foundation](https://contentsquare-foundation.org/), Readapt is a software platform that aims to help those with reading challenges like dyslexia to more easily read digital text. The [Microsoft Word version](https://appsource.microsoft.com/en-us/product/office/WA200004098?tab=Overview) of Readapt allows users to set their reading preferences and see an adaptation of the Word document's text. It also provides reading tools like a screen mask and reading ruler.

## Operating system and Microsoft Office compatibility
### MacOS
### MacOS
Readapt can be used on most recent releases of MacOS and Microsoft Office.

### Microsoft Office Online
Expand Down
3 changes: 0 additions & 3 deletions apps/ms-word-addin/babel.config.js

This file was deleted.

1 change: 1 addition & 0 deletions apps/ms-word-addin/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
27 changes: 27 additions & 0 deletions apps/ms-word-addin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Readapt by Contentsquare Foundation</title>
<link rel="preload" href="/fonts/Luciole-Regular.ttf" type="font/ttf" as="font" crossorigin />
<link rel="preload" href="/fonts/Luciole-Bold.ttf" type="font/ttf" as="font" crossorigin />
<link rel="preload" href="/fonts/OpenDyslexic-Regular.otf" type="font/otf" as="font" crossorigin/>
<link rel="preload" href="/fonts/OpenDyslexic-Bold.otf" type="font/otf" as="font" crossorigin/>
<link rel="stylesheet" href="/fonts.css" />

<link ref="preload" href="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" as="script" crossorigin="true" />
<link rel="preload" href="https://appsforoffice.microsoft.com/lib/1/hosted/o15apptofilemappingtable.js" as="script" crossorigin="true" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/app/index.ts"></script>

<script>
if (navigator.userAgent.indexOf('Trident') !== -1) {
document.getElementById('app').innerHTML = "We detect that you are using an Office version that uses Internet Explorer 11. This, unfortunately, is not supported by Readapt. We apologise for the incovenience."
}
</script>
</body>
</html>
3 changes: 0 additions & 3 deletions apps/ms-word-addin/jest.config.js

This file was deleted.

85 changes: 42 additions & 43 deletions apps/ms-word-addin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"version": "1.7.4",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "yarn test:unit",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint",
"dev": "vite",
"build": "rm -rf ./dist && run-p type-check build-ui",
"preview": "vite preview --port 4173",
"test": "yarn test:unit --run",
"test:unit": "vitest",
"build-ui": "vite build",
"type-check": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"clean": "shx rm -rf dist",
"start": "office-addin-debugging start manifest.xml",
"start:desktop": "office-addin-debugging start manifest.xml desktop",
Expand All @@ -19,54 +22,50 @@
"postinstall": "node scripts/init-env"
},
"dependencies": {
"@readapt/settings": "^1.7.4",
"@readapt/shared-components": "^1.7.4",
"@readapt/text-engine": "^1.7.4",
"@readapt/visual-engine": "^1.7.4",
"bootstrap": "~4.6.2",
"bootstrap-vue": "~2.23.1",
"core-js": "^3.8.3",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"vue": "~2.7.14",
"vue-i18n": "~8.28.2",
"vue-router": "~3.5.1",
"vue-sanitize": "^0.2.2",
"vuex": "~3.6.2"
"@readapt/settings": "^1.7.1",
"@readapt/text-engine": "^1.7.1",
"@readapt/visual-engine": "^1.7.1",
"dotenv": "^16.0.3",
"lodash-es": "^4.17.21",
"sanitize-html": "^2.8.1",
"vue": "~3.2.45",
"vue-i18n": "~9.2.2",
"vue-router": "~4.1.6",
"vue3-promise-dialog": "^0.3.4"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.179",
"@types/lodash-es": "^4.17.6",
"@types/node": "^16.18.10",
"@types/office-js": "^1.0.180",
"@types/office-runtime": "^1.0.17",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.4",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-unit-jest": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/test-utils": "^1.3.0",
"@vue/vue2-jest": "^27.0.0",
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.6.0",
"jest": "^27.1.0",
"@types/sanitize-html": "^2.8.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/test-utils": "^2.2.8",
"@vue/tsconfig": "^0.1.3",
"autoprefixer": "^10.4.13",
"daisyui": "^2.46.1",
"eslint": "^8.30.0",
"eslint-plugin-tailwindcss": "^3.8.0",
"eslint-plugin-vue": "^9.8.0",
"jsdom": "^21.1.0",
"npm-run-all": "^4.1.5",
"office-addin-cli": "^1.3.5",
"office-addin-debugging": "^4.3.8",
"office-addin-dev-certs": "^1.7.7",
"office-addin-dev-settings": "^1.10.8",
"office-addin-lint": "^2.0.0",
"office-addin-manifest": "^1.7.7",
"prettier": "^2.4.1",
"postcss": "^8.4.20",
"prettier": "^2.8.1",
"sass": "^1.57.1",
"sass-loader": "^12.0.0",
"ts-jest": "^27.0.4",
"typescript": "~4.9.4"
"tailwindcss": "^3.2.4",
"terser": "^5.16.1",
"typescript": "~4.9.4",
"vite": "^4.0.4",
"vite-plugin-static-copy": "^0.13.0",
"vitest": "^0.27.0",
"vue-tsc": "^1.0.24"
}
}
8 changes: 8 additions & 0 deletions apps/ms-word-addin/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env node */

module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
Binary file added apps/ms-word-addin/public/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/ms-word-addin/public/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/ms-word-addin/public/icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/ms-word-addin/public/icons/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions apps/ms-word-addin/public/icons/fragments.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 0 additions & 31 deletions apps/ms-word-addin/public/index.html

This file was deleted.

14 changes: 14 additions & 0 deletions apps/ms-word-addin/scripts/package-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env node

const pkg = require('../package.json')
const { execSync } = require('child_process')
const path = require('path')

const version = pkg.version
const name = `readapt-chrome-extension-v${version}.zip`
const distPath = path.join(__dirname, '../dist')

console.log(`package release ${name}...`)
execSync(`cd ${distPath} && zip -r ${name} .`)
console.log('package complete!')
console.log(`Output ${distPath}${name}`)
3 changes: 3 additions & 0 deletions apps/ms-word-addin/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { mountUI } from './mount'

mountUI()
7 changes: 7 additions & 0 deletions apps/ms-word-addin/src/app/model/useSetup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { textPreferencesStatePersist } from '@/entities/textPreferences'
import { StorageLocal } from '@/shared/lib/storage'

export function useSetup() {
const storage = new StorageLocal()
textPreferencesStatePersist(storage)
}
21 changes: 21 additions & 0 deletions apps/ms-word-addin/src/app/mount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { createApp } from 'vue'
import App from './ui/App.vue'

import { withOffice } from './providers/withOffice'
import { withi18n } from './providers/withi18n'
import { withRouter } from './providers/withRouter'

import './styles/tailwind.scss'

export const mountUI = async () => {
const { i18n } = await withi18n()
const { router } = withRouter()

await withOffice()

const app = createApp(App)
app.use(i18n)
app.use(router)

app.mount('#app')
}
25 changes: 25 additions & 0 deletions apps/ms-word-addin/src/app/providers/withOffice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
let promise: Promise<void> | null = null

export const withOffice = async () => {
const replaceState = window.history.replaceState
const pushState = window.history.pushState

if (!promise) {
promise = new Promise((resolve) => {
const script = document.createElement('script')
script.src = 'https://appsforoffice.microsoft.com/lib/1/hosted/office.js'
script.onload = () => {
Office.onReady(() => {
// Note: this is a workaround to fix msoffice breaking vue-router
// @see https://github.com/OfficeDev/office-js/pull/2808
window.history.replaceState = replaceState
window.history.pushState = pushState

resolve()
})
}
document.body.appendChild(script)
})
}
return promise
}
Loading