├── .babelrc
├── .gitignore
├── LICENSE
├── assets
├── icons
│ └── favicon.ico
└── templates
│ ├── .debug.template.js
│ └── manifest.template.xml.js
├── build-scripts
├── archive.js
├── build.js
├── deploy.js
├── utils.js
├── webpack.client.config.js
└── webpack.session.config.js
├── kap.gif
├── package-lock.json
├── package.json
├── pluginrc.js
├── readme.md
└── src
├── client-src
├── App.jsx
├── assets
│ ├── css
│ │ └── style.css
│ └── fonts
│ │ ├── material-icons
│ │ ├── files
│ │ │ └── icons.woff2
│ │ └── index.css
│ │ └── typeface-roboto
│ │ ├── README.md
│ │ ├── files-hash.json
│ │ ├── files
│ │ ├── roboto-latin-300.woff
│ │ ├── roboto-latin-300.woff2
│ │ ├── roboto-latin-400.woff
│ │ ├── roboto-latin-400.woff2
│ │ ├── roboto-latin-500.woff
│ │ └── roboto-latin-500.woff2
│ │ ├── index.css
│ │ └── package.json
├── comps-bootstrap
│ ├── AppBS.jsx
│ ├── BrowseItem.jsx
│ ├── Config.jsx
│ ├── Debug.jsx
│ ├── Decal.jsx
│ ├── Home.jsx
│ ├── Navigator.jsx
│ ├── PluginItem.jsx
│ ├── Upload.jsx
│ └── backup
│ │ ├── css
│ │ ├── bootstrap-4.1.3-dist
│ │ │ ├── css
│ │ │ │ ├── bootstrap-grid.css
│ │ │ │ ├── bootstrap-grid.css.map
│ │ │ │ ├── bootstrap-grid.min.css
│ │ │ │ ├── bootstrap-grid.min.css.map
│ │ │ │ ├── bootstrap-reboot.css
│ │ │ │ ├── bootstrap-reboot.css.map
│ │ │ │ ├── bootstrap-reboot.min.css
│ │ │ │ ├── bootstrap-reboot.min.css.map
│ │ │ │ ├── bootstrap.css
│ │ │ │ ├── bootstrap.css.map
│ │ │ │ ├── bootstrap.min.css
│ │ │ │ └── bootstrap.min.css.map
│ │ │ └── js
│ │ │ │ ├── bootstrap.bundle.js
│ │ │ │ ├── bootstrap.bundle.js.map
│ │ │ │ ├── bootstrap.bundle.min.js
│ │ │ │ ├── bootstrap.bundle.min.js.map
│ │ │ │ ├── bootstrap.js
│ │ │ │ ├── bootstrap.js.map
│ │ │ │ ├── bootstrap.min.js
│ │ │ │ ├── bootstrap.min.js.map
│ │ │ │ └── jquery-3.3.1.min.js
│ │ ├── jquery-3.3.1.min.js
│ │ ├── popper.min.js
│ │ └── style.css
│ │ └── index.html
├── comps
│ ├── BrowseItem.jsx
│ ├── Config.jsx
│ ├── Debug.jsx
│ ├── Hideable.jsx
│ ├── Home.jsx
│ ├── Navigator.jsx
│ ├── PluginItem.jsx
│ └── Upload.jsx
├── controller.js
├── index.js
├── index.server.template.html
└── readme.md
├── host
├── JSON.jsx
├── index.jsx
└── main.jsx
├── index.html
├── index.template.html
├── libs
└── CSInterface.js
└── session-src
├── .gitignore
├── index.js
├── package-lock.json
├── package.json
└── src
├── ScriptLoader.js
├── Session.js
└── managers
├── DataManagers.js
└── LogManager.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "react",
5 | "stage-2"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | /dist/
3 | .DS_Store
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/assets/icons/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HendrixString/adobe-cep-react-create/a9c776cb721e9c23cc02a770a3295c96f4006466/assets/icons/favicon.ico
--------------------------------------------------------------------------------
/assets/templates/.debug.template.js:
--------------------------------------------------------------------------------
1 | module.exports = (props) =>
2 | `
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | `
19 |
--------------------------------------------------------------------------------
/assets/templates/manifest.template.xml.js:
--------------------------------------------------------------------------------
1 | module.exports = (props) =>
2 | `
3 |
4 |
9 |
10 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ./index.html
40 | ./host/index.jsx
41 |
42 | --enable-nodejs
43 | --allow-file-access
44 | --allow-file-access-from-files
45 |
46 |
47 |
48 | true
49 |
50 |
51 | Panel
52 |
53 |
54 |
55 | ${props.width}
56 | ${props.height}
57 |
58 |
59 | ${props.width}
60 | ${props.height}
61 |
62 |
63 | ${props.width}
64 | ${props.height}
65 |
66 |
67 |
68 | ./icons/favicon.ico
69 | ./icons/favicon.ico
70 | ./icons/favicon.ico
71 | ./icons/favicon.ico
72 |
73 |
74 |
75 |
76 |
77 | `
78 |
--------------------------------------------------------------------------------
/build-scripts/archive.js:
--------------------------------------------------------------------------------
1 | /**
2 | * archive, generates self signed certificate and signing a zxp package
3 | */
4 | const fs = require('fs')
5 | const path = require('path')
6 | const zxpSignCmd = require('zxp-sign-cmd')
7 | const utils = require('./utils.js')
8 | const pluginConfig = require('../pluginrc.js')
9 | const isWindows = utils.resolveWindows()
10 | const distFolder = pluginConfig.destinationFolder
11 | const pluginFolder = path.join(distFolder, pluginConfig.extensionBundleId)
12 | const extensionBundleId = pluginConfig.extensionBundleId
13 | const certificate_options = pluginConfig.certificate
14 | const zxpFile = path.join(distFolder, pluginConfig.extensionBundleId + '.zxp')
15 |
16 | archive()
17 |
18 | function archive() {
19 | utils.log_progress('ARCHIVE', 'blue')
20 |
21 | prepareCert()
22 | .then(signPackage)
23 | .then(res => {
24 | utils.log_progress(`package is signed: ${zxpFile}`, 'green')
25 | utils.log_progress('DONE', 'blue')
26 | })
27 | .catch(err => {utils.log_error(err)})
28 | }
29 |
30 | /**
31 | * find a custom certificate or generate a self sign the certificate
32 | *
33 | * @return {Promise} a promise, that resolves the cert data {path, password}
34 | */
35 | function prepareCert() {
36 | const options_custom_cert = certificate_options.customCert
37 | const options_self_sign = certificate_options.selfSign
38 | const isCustom = options_custom_cert && options_custom_cert.path.trim() !== ''
39 | var path='', password=''
40 |
41 | if(isCustom) {
42 | path = options_custom_cert.path
43 | password = options_custom_cert.password
44 | } else if(options_self_sign){
45 | path = options_self_sign.output
46 | password = options_self_sign.password
47 | }
48 |
49 | const isValid = path!==undefined && path.trim()!==''
50 | const data = {path, password}
51 |
52 | // on non windows, we need to change the permissions
53 | if(!isWindows) {
54 | var provider = require('zxp-provider').osx
55 | // for some reason the path returns quoted, so I un-quote
56 | var unquote = provider.substring(1, provider.length - 1)
57 | fs.chmodSync(unquote, '755')
58 | }
59 |
60 | return new Promise((resolve, reject) => {
61 | if(!isValid) {
62 | reject('no valid cert info')
63 |
64 | return
65 | }
66 |
67 | if(isCustom) {
68 | utils.log_progress('found a custom certificate')
69 | resolve(data)
70 | } else {
71 | utils.log_progress('generating a self signed certificate')
72 | zxpSignCmd.selfSignedCert(options_self_sign, function (error, result) {
73 | if(error) reject(error)
74 | else resolve(data)
75 | })
76 |
77 | }
78 |
79 | })
80 |
81 | }
82 |
83 | /**
84 | * sign the package
85 | *
86 | * @param {{path, password}} cert description
87 | *
88 | * @return {Promise} a promise
89 | */
90 | function signPackage(cert) {
91 | const options = {
92 | input: pluginFolder,
93 | output: zxpFile,
94 | cert: cert.path,
95 | password: cert.password
96 | }
97 |
98 | return new Promise((resolve, reject) => {
99 | zxpSignCmd.sign(options, function (error, result) {
100 | if(error) reject(error)
101 | else resolve(result)
102 |
103 | })
104 |
105 | })
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/build-scripts/build.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * a minimalist non fancy build script
4 | */
5 |
6 | const fs = require('fs')
7 | const path = require('path')
8 | const { execSync } = require('child_process')
9 | const utils = require('./utils.js')
10 | const webpack = require('webpack')
11 | const pluginConfig = require('../pluginrc.js')
12 | const env = utils.resolveEnv()
13 | const isDev = env==='development'
14 | const distFolder = pluginConfig.destinationFolder
15 | const pluginFolder = path.join(distFolder, pluginConfig.extensionBundleId)
16 | const srcFolder = pluginConfig.sourceFolder
17 | const rootFolder = pluginConfig.root
18 | const templatesFolder = path.join(fromRoot('assets'), 'templates')
19 | const webpack_client_config_path = path.join(__dirname, 'webpack.client.config.js')
20 | const webpack_session_config_path = path.join(__dirname, 'webpack.session.config.js')
21 | utils.log_progress(`BUILD for ${env}`, 'blue')
22 |
23 | build()
24 |
25 | function build() {
26 | try {
27 | // delete the dist
28 | utils.log_progress('cleaning dist...')
29 | utils.deleteFolderRecursive(distFolder)
30 | // create dist
31 | fs.mkdirSync(distFolder)
32 | fs.mkdirSync(pluginFolder)
33 | // bundle the client
34 | utils.log_progress('bundeling client...')
35 | // var config = require('../webpack.client.config.js')
36 | // webpack(config, (err, stats) => {
37 | // if (err) {
38 | // console.error(err);
39 | // return;
40 | // }
41 | //
42 | // console.log(stats.toString({
43 | // chunks: false, // Makes the build much quieter
44 | // colors: true // Shows colors in the console
45 | // }));
46 | // });
47 |
48 | execSync(`webpack --config ${webpack_client_config_path} --display minimal --display-chunks --env.target=node --mode ${env}`, {stdio:[0,1,2]})
49 | // bundle the session
50 | utils.log_progress('bundeling session...')
51 | execSync(`webpack --config ${webpack_session_config_path} --display normal --display-chunks --env.target=node --mode ${env}`, {stdio:[0,1,2]})
52 | // copy the host code
53 | utils.log_progress('copying host code...')
54 | utils.copyRecursiveSync(fromSrc('host'), fromPlugin('host'))
55 | // copy the session's node modules folder
56 | utils.log_progress('copying session node-modules...')
57 | utils.copyRecursiveSync(fromSrc('session-src/node_modules'), fromPlugin('node_modules'))
58 | // copying libs folder
59 | utils.log_progress('copying libs folder...')
60 | utils.copyRecursiveSync(fromSrc('libs'), fromPlugin('libs'))
61 | // copy the index.html
62 | // fs.createReadStream('./src/index.html').pipe(fs.createWriteStream('./dist/index.html'));
63 | utils.log_progress('copying index.html...')
64 | utils.copyRecursiveSync(fromSrc('index.html'), fromPlugin('index.html'))
65 | // copy other assets
66 | utils.log_progress('copying Adobe assets...')
67 | utils.copyRecursiveSync(fromRoot('assets'), pluginFolder, ['templates'])
68 | // render manifest.xml
69 | utils.log_progress('rendering manifest.xml ...')
70 | var manifest_template = require(path.join(templatesFolder, 'manifest.template.xml.js'))
71 | var rendered_xml = manifest_template(pluginConfig)
72 |
73 | var xml_out_dir = path.join(pluginFolder, 'CSXS')
74 | fs.mkdir(xml_out_dir, { recursive: true }, (err) => {if (err) throw err;});
75 |
76 | var xml_out_file = path.join(pluginFolder, 'CSXS', 'manifest.xml')
77 | fs.writeFileSync(xml_out_file, rendered_xml, 'utf-8')
78 |
79 | // in dev, also render the .debug file template
80 | if(isDev) {
81 | // render .debug file
82 | utils.log_progress('rendering .debug file ...')
83 | var debug_template = require(path.join(templatesFolder, '.debug.template.js'))
84 | var rendered_debug = debug_template(pluginConfig)
85 | var debug_out_file = path.join(pluginFolder, '.debug')
86 | fs.writeFileSync(debug_out_file, rendered_debug, 'utf-8')
87 | }
88 |
89 | utils.log_progress('DONE', 'blue')
90 | } catch(err) {
91 | utils.log_progress(err, 'red')
92 | }
93 | }
94 |
95 | function fromDist(val) {
96 | return path.join(distFolder, val)
97 | }
98 |
99 | function fromPlugin(val) {
100 | return path.join(pluginFolder, val)
101 | }
102 |
103 | function fromSrc(val) {
104 | return path.join(srcFolder, val)
105 | }
106 |
107 | function fromRoot(val) {
108 | return path.join(rootFolder, val)
109 | }
110 |
--------------------------------------------------------------------------------
/build-scripts/deploy.js:
--------------------------------------------------------------------------------
1 | /**
2 | * deploy in dev mode or production
3 | */
4 | const { execSync } = require('child_process')
5 | const fs = require('fs')
6 | const os = require('os')
7 | const path = require('path')
8 | const utils = require('./utils.js')
9 | const pluginConfig = require('../pluginrc.js')
10 | const distFolder = path.join(pluginConfig.destinationFolder, pluginConfig.extensionBundleId)
11 | const env = utils.resolveEnv()
12 | const isDev = env === 'development'
13 | const isWindows = utils.resolveWindows()
14 | const extensionBundleId = pluginConfig.extensionBundleId
15 | const resolvedTargetFolder = resolveDeploymentFolder()
16 |
17 | deploy()
18 |
19 | /**
20 | * deploy
21 | *
22 | */
23 | function deploy() {
24 | utils.log_progress(`DEPLOY for ${env}`, 'blue')
25 |
26 | cleanTarget(resolvedTargetFolder)
27 |
28 | if(isDev)
29 | deployDevMode()
30 | else
31 | deployProdMode()
32 |
33 | printDeploymentFolder()
34 |
35 | utils.log_progress('DONE', 'blue')
36 | }
37 |
38 | function printDeploymentFolder() {
39 | utils.log_progress(`deployed to folder ${resolvedTargetFolder}`, 'green')
40 | }
41 |
42 | /**
43 | * resolve the final deployment folder
44 | *
45 | */
46 | function resolveDeploymentFolder() {
47 | return path.join(resolveExtensionFolder(), extensionBundleId)
48 | }
49 |
50 | /**
51 | * per os Adobe extension folder
52 | *
53 | */
54 | function resolveExtensionFolder() {
55 | if (isWindows) {
56 | const extensionsPath = os.userInfo().homedir + '\\AppData\\Roaming\\Adobe\\CEP\\extensions'
57 | if (!fs.existsSync(extensionsPath))
58 | fs.mkdirSync(extensionsPath, { recursive: true })
59 |
60 | return extensionsPath;
61 | } else {
62 | return path.join(os.homedir(), 'Library/Application Support/Adobe/CEP/extensions')
63 | }
64 |
65 | }
66 |
67 | /**
68 | * cleanTarget - clean the target folder. if it is a
69 | * symlink then unlink, and if it is a folder then delete.
70 | *
71 | */
72 | function cleanTarget(target) {
73 | utils.log_progress('cleaning target')
74 |
75 | try {
76 | if(fs.existsSync(target) && fs.lstatSync(target).isSymbolicLink())
77 | fs.unlinkSync(target)
78 | utils.deleteFolderRecursive(target)
79 | } catch (err) {
80 | utils.log_error(err)
81 | }
82 | }
83 |
84 | /**
85 | * deployDevMode - just create a symlink
86 | *
87 | */
88 | function deployDevMode() {
89 | try {
90 | utils.log_progress('patching')
91 | if (isWindows) {
92 | execSync('REG ADD HKEY_CURRENT_USER\\Software\\Adobe\\CSXS.8 /v PlayerDebugMode /t REG_SZ /d 1 /f') // CC 2018
93 | execSync('REG ADD HKEY_CURRENT_USER\\Software\\Adobe\\CSXS.9 /v PlayerDebugMode /t REG_SZ /d 1 /f') // CC 2019 & 2020
94 | } else {
95 | execSync('defaults write com.adobe.CSXS.8 PlayerDebugMode 1', { stdio: [0, 1, 2] }) // CC 2018
96 | execSync('defaults write com.adobe.CSXS.9 PlayerDebugMode 1', { stdio: [0, 1, 2] }) // CC 2019 & 2020
97 | }
98 | } catch(err) {
99 | utils.log_error(err)
100 | }
101 |
102 | utils.log_progress('creating symlink into extensions folder')
103 | try {
104 | var type = isWindows ? 'junction' : 'dir'
105 |
106 | fs.symlinkSync(distFolder, resolvedTargetFolder, type)
107 | } catch(err) {
108 | utils.log_error(err)
109 | }
110 |
111 | }
112 |
113 | /**
114 | * deployProdMode - copy the whole dist folder
115 | *
116 | */
117 | function deployProdMode() {
118 |
119 | utils.log_progress('copying into extensions folder')
120 | try {
121 | utils.copyRecursiveSync(distFolder, resolvedTargetFolder)
122 |
123 | } catch(err) {
124 | utils.log_error(err)
125 | }
126 |
127 | }
128 |
--------------------------------------------------------------------------------
/build-scripts/utils.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * the build script for the whole thing
4 | */
5 |
6 | const { execSync } = require('child_process')
7 | var fs = require('fs')
8 | var path = require('path')
9 | const chalk = require('chalk');
10 |
11 | function deleteFolderRecursive(src) {
12 | if (fs.existsSync(src)) {
13 | fs.readdirSync(src).forEach(function(file, index){
14 | var curPath = path.join(src, file)
15 | if (fs.lstatSync(curPath).isDirectory()) { // recurse
16 | deleteFolderRecursive(curPath)
17 | } else { // delete file
18 | fs.unlinkSync(curPath)
19 | }
20 | })
21 | fs.rmdirSync(src)
22 | }
23 | }
24 |
25 | function hasInList(item, list) {
26 | var res = false
27 |
28 | if(!list)
29 | return false
30 |
31 | list.forEach(one => {
32 | if(one===item) {
33 | res = true
34 | return
35 | }
36 | })
37 |
38 | return res
39 | }
40 |
41 | /**
42 | * Look ma, it's cp -R.
43 | * @param {string} src The path to the thing to copy.
44 | * @param {string} dest The path to the new copy.
45 | * @param {ignore_list} folders to ignore in the first level only
46 | */
47 | function copyRecursiveSync(src, dest, ignore_list) {
48 | var exists = fs.existsSync(src)
49 | var exists_dest = fs.existsSync(dest)
50 | var stats = exists && fs.statSync(src)
51 | var isDirectory = exists && stats.isDirectory()
52 | if (exists && isDirectory) {
53 | if(!exists_dest)
54 | fs.mkdirSync(dest)
55 | fs.readdirSync(src).filter(item => !hasInList(item, ignore_list))
56 | .forEach(childItemName => {
57 | copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))
58 | })
59 | } else {
60 | fs.linkSync(src, dest)
61 | }
62 | }
63 |
64 | function log(val) {
65 | console.log(val)
66 | }
67 |
68 | function log_error(val) {
69 | log_progress(val, 'red')
70 | }
71 |
72 | function log_progress(val, color) {
73 | var c = color ? color : 'yellow'
74 |
75 | console.log(chalk[c](val))
76 | }
77 |
78 | function resolveWindows() {
79 | return process.platform.startsWith('win')
80 | }
81 |
82 | /**
83 | * resolve env from process argumants
84 | *
85 | */
86 | function resolveEnv() {
87 | var env = 'development'
88 |
89 | var args = process.argv
90 |
91 | // we have an argument
92 | if(args.length >= 3) {
93 | env = args[2]
94 | }
95 |
96 | return env
97 | }
98 |
99 | module.exports = {
100 | deleteFolderRecursive,
101 | copyRecursiveSync,
102 | log,
103 | log_error,
104 | log_progress,
105 | resolveWindows,
106 | resolveEnv
107 | }
108 |
--------------------------------------------------------------------------------
/build-scripts/webpack.client.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
3 | const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4 | const pluginConfig = require('../pluginrc.js')
5 | // const distFolder = pluginConfig.destinationFolder
6 | const distFolder = path.join(pluginConfig.destinationFolder, pluginConfig.extensionBundleId)
7 | const srcFolder = pluginConfig.sourceFolder
8 | const CLIENT_DIST_PATH = path.resolve(distFolder, 'client-dist')
9 | const HTML_TEMPLATE_PATH = path.join(srcFolder, 'client-src/index.server.template.html')
10 | const ENTRY_POINT_CLIENT_PATH = path.join(srcFolder, 'client-src/index.js')
11 |
12 | module.exports = ({
13 | entry: ENTRY_POINT_CLIENT_PATH,
14 | target: 'web',
15 | module: {
16 | rules: [
17 | {
18 | test: /\.(js|jsx)$/,
19 | exclude: /node_modules/,
20 | loader: "babel-loader",
21 | options: {
22 | presets: ['env', 'react', 'stage-2']
23 | }
24 |
25 | },
26 | {
27 | test: /\.(woff|woff2|eot|ttf|svg)$/,
28 | loader: 'file-loader',
29 | options: {
30 | name: 'fonts/[name].[ext]'
31 | }
32 | },
33 | {
34 | test:/\.css$/,
35 | use:[MiniCssExtractPlugin.loader,'css-loader']
36 | }]
37 | },
38 | resolve: {
39 | extensions: ['*', '.js', '.jsx']
40 | },
41 | output: {
42 | path: CLIENT_DIST_PATH,
43 | publicPath: '',
44 | filename: 'bundle.js'
45 | },
46 | devtool: 'source-map',
47 | devServer: {
48 | contentBase: CLIENT_DIST_PATH
49 | },
50 | plugins: [
51 | new MiniCssExtractPlugin({
52 | // Options similar to the same options in webpackOptions.output
53 | // both options are optional https://github.com/webpack-contrib/mini-css-extract-plugin
54 | filename: "[name].css",
55 | chunkFilename: "[id].css"
56 | }),
57 | new HtmlWebpackPlugin({
58 | template: HTML_TEMPLATE_PATH,
59 | filename: 'index.html',
60 | inject: 'body',
61 | title: 'HTML Webpack Plugin',
62 | bar: 'bar'
63 | })
64 | ]
65 |
66 | })
67 |
--------------------------------------------------------------------------------
/build-scripts/webpack.session.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | // const CopyWebpackPlugin = require('copy-webpack-plugin')
3 | const nodeExternals = require('webpack-node-externals');
4 | const pluginConfig = require('../pluginrc.js')
5 | const distFolder = path.join(pluginConfig.destinationFolder, pluginConfig.extensionBundleId)
6 | const srcFolder = pluginConfig.sourceFolder
7 | const SESSION_DIST_PATH = path.join(distFolder, 'session-dist')
8 | const SESSION_SRC_PATH = path.join(srcFolder, 'session-src')
9 | const ENTRY_POINT_SESSION_PATH = path.join(SESSION_SRC_PATH, 'index.js')
10 |
11 | module.exports = (env) => ({
12 | entry: ENTRY_POINT_SESSION_PATH,
13 | target: 'node',
14 | externals: [nodeExternals({modulesDir: path.join(SESSION_SRC_PATH, 'node_modules')})],
15 | module: {
16 | rules: [
17 | {
18 | test: /\.(js|jsx)$/,
19 | exclude: /node_modules/,
20 | loader: "babel-loader",
21 | options: {
22 | presets: ['env', 'react', 'stage-2']
23 | }
24 |
25 | }]
26 | },
27 | resolve: {
28 | extensions: ['*', '.js', '.jsx']
29 | },
30 | output: {
31 | path: SESSION_DIST_PATH,
32 | publicPath: '',
33 | filename: 'bundle.js'
34 | },
35 | devtool: 'source-map',
36 | plugins: [
37 | // new CopyWebpackPlugin([
38 | // { from: path.join(SESSION_SRC_PATH, 'node_modules'), to: '../node_modules' }
39 | // ])
40 | ]
41 |
42 | })
43 |
--------------------------------------------------------------------------------
/kap.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HendrixString/adobe-cep-react-create/a9c776cb721e9c23cc02a770a3295c96f4006466/kap.gif
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cep-test",
3 | "version": "1.0.0",
4 | "description": "demo for CEP",
5 | "main": "./client-src/src/index.js",
6 | "scripts": {
7 | "build": "node ./scripts/build.js",
8 | "start": "npm run client:dev-server",
9 | "client:dev-server": "webpack-dev-server --config ./build-scripts/webpack.client.config.js --env.target=web --mode development --open",
10 | "build:dev": "node ./build-scripts/build.js development",
11 | "build:prod": "node ./build-scripts/build.js production",
12 | "deploy:dev": "node ./build-scripts/deploy.js development",
13 | "deploy:prod": "node ./build-scripts/deploy.js production",
14 | "archive": "node ./build-scripts/archive.js",
15 | "release:dev": "npm run build:dev && npm run deploy:dev",
16 | "release:prod": "npm run build:prod && npm run deploy:prod && npm run archive",
17 | "postinstall": "mkdirp src/session-src/node_modules",
18 | "b": "babel ./client/js --out-dir ./client/out",
19 | "test": "echo \"Error: no test specified\" && exit 1"
20 | },
21 | "author": "Tomer Shalev (HendrixString)",
22 | "license": "ISC",
23 | "devDependencies": {
24 | "babel-cli": "^6.26.0",
25 | "babel-core": "^6.26.3",
26 | "babel-loader": "^7.1.5",
27 | "babel-preset-env": "^1.7.0",
28 | "babel-preset-react": "^6.24.1",
29 | "babel-preset-stage-2": "^6.24.1",
30 | "chalk": "^2.4.1",
31 | "copy-webpack-plugin": "^4.5.2",
32 | "css-loader": "^1.0.0",
33 | "extract-text-webpack-plugin": "^4.0.0-beta.0",
34 | "file-loader": "^1.1.11",
35 | "hard-source-webpack-plugin": "^0.12.0",
36 | "html-webpack-plugin": "^3.2.0",
37 | "mini-css-extract-plugin": "^0.4.1",
38 | "mkdirp": "^0.5.1",
39 | "style-loader": "^0.21.0",
40 | "webpack": "^4.16.2",
41 | "webpack-cli": "^3.1.0",
42 | "webpack-dev-server": "^3.7.2",
43 | "webpack-node-externals": "^1.7.2",
44 | "zxp-sign-cmd": "^1.0.0"
45 | },
46 | "dependencies": {
47 | "@material-ui/core": "^1.4.2",
48 | "@material-ui/icons": "^2.0.0",
49 | "console-feed": "^2.8.3",
50 | "react": "^16.4.1",
51 | "react-dom": "^16.4.1"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/pluginrc.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const root = __dirname
3 | const srcFolder = path.join(root, "src")
4 | const destFolder = path.join(root, "dist")
5 | const certPath = path.join(destFolder, "cert.p12")
6 | module.exports = {
7 | extensionBundleId: 'com.hendrix.demo',
8 | extensionBundleName: 'demo',
9 | extensionBundleVersion: '1.0.1',
10 | cepVersion: '7.0',
11 | panelName: 'hendrix demo',
12 | width: '400',
13 | height: '600',
14 | root: root,
15 | sourceFolder: srcFolder,
16 | destinationFolder: destFolder,
17 | certificate : {
18 | customCert: {
19 | path: '',
20 | password: 'password'
21 | },
22 | selfSign: {
23 | country: 'US',
24 | province: 'CA',
25 | org: 'org',
26 | name: 'name',
27 | password: 'password',
28 | locality: 'locality',
29 | orgUnit: 'orgUnit',
30 | email: 'your@email.com',
31 | output: certPath
32 | }
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | ## Create Adobe-CEP extension
2 | ### Adobe-CEP with React, Material-UI, Native Node modules, Webpack, Babel and ExtendScript
3 |
4 |
5 |
6 | this Adobe-CEP extension creator bootstraps for creating Adobe CC extensions easily with
7 | modern web technologies and with native node.js modules for session logic
8 | and with support for extendscript (host app). It is built in a semi opinionated
9 | way so you can focus on writing your great extensions.
10 |
11 | #### how to build
12 | first run `npm install`, then choose
13 | - `npm run build:dev` / `npm run build:prod` - will build into `./dist` folder
14 | - `npm run deploy:dev` / `npm run deploy:prod` - will deploy `./dist` folder into the extension folder.
15 | if in dev mode, it will create a **symbolic link**, otherwise it will copy the entire folder.
16 | - `npm run archive` will create a self signed certificate and sign a **ZXP** package ready to publish
17 | - `npm run release:dev` / `npm run release:prod` - will build, deploy and archive (in production)
18 |
19 | the output is a `./dist` extension folder
20 | ```
21 | dist
22 | com.package.name/
23 | index.html
24 | .debug
25 | CSXS/
26 | manifest.xml
27 | icons/
28 | favicon.ico
29 | node_modules/
30 | host/
31 | index.js
32 | client-dist/
33 | bundle.js
34 | main.css
35 | session-dist/
36 | bundle.js
37 | host/
38 | libs/
39 | CSInterface.js
40 | ```
41 |
42 | #### how to customize
43 | start with `./pluginrc.js`, this is the plugin config I created, here is an example
44 | ```javascript
45 | module.exports = {
46 | extensionBundleId: 'com.hendrix.demo',
47 | extensionBundleName: 'demo',
48 | extensionBundleVersion: '1.0.1',
49 | cepVersion: '7.0',
50 | panelName: 'hendrix demo',
51 | width: '400',
52 | height: '600',
53 | root: root,
54 | sourceFolder: srcFolder,
55 | destinationFolder: destFolder,
56 | certificate : {
57 | customCert: {
58 | path: '',
59 | password: 'password'
60 | },
61 | selfSign: {
62 | country: 'US',
63 | province: 'CA',
64 | org: 'org',
65 | name: 'name',
66 | password: 'password',
67 | locality: 'locality',
68 | orgUnit: 'orgUnit',
69 | email: 'your@email.com',
70 | output: certPath
71 | }
72 |
73 | }
74 |
75 | }
76 | ```
77 | when build is happening, then the build will pickup your package id and panel name
78 | and other configurations from this file and will use it against a template that will
79 | generate the `./dist/CSXS/manifest.xml` and `.debug` (in dev mode) file for you.
80 | also, I added support for a custom certificate and for a self-signed certificate.
81 | feel free to modify the contents of the `assets` folder for you own need.
82 |
83 | #### how to debug
84 | debugging is achieved through the chrome debugger
85 | - release a dev build with `npm run release:dev`
86 | - inside Adobe, open the extension, you may have to restart if this is the first time.
87 | - open a browser at the following location http://localhost:`PORT`/ (See port number in .debug file)
88 |
89 | ### what does this include ?
90 | this bootstrap is composed of three parts
91 |
92 | #### Front end side
93 | inside `src/client-src` you have the entry point for creating ReactJS application.
94 | installing modules is against the project root, see `/project.json`.
95 | a nice feature, that it has is that you can use `webpack-dev-server` to see
96 | your UI results with watching at the browser, simply use:
97 | - `npm start` or
98 | - `npm run client:dev-server`
99 | this will generate the template html for you and run it in your browser,
100 | and will rebuild on code changes which is nice to have.
101 |
102 | #### back end side / session (using node modules)
103 | inside `src/session-src` you have the entry point for using native node.js modules.
104 | Adobe-CEP supports instantiating Node.js runtime as well as Chromium but I believe
105 | most developers would like to use the power of Node.js for doing IO.
106 |
107 | Adobe-CEP does provide it's native IO for disk access and also using Chromium
108 | you can use the browser `Fetch` api, but it can lead to very bad code structuring.
109 |
110 | I inject the `session` object in the `window` object and therefore it is accessible
111 | even from the front end side.
112 | Also notice, that this folder has it's own `node-modules` separate from the root folder,
113 | this is because, they are built differently from the Front end side.
114 |
115 | using node modules can enhance the functionality.
116 |
117 | #### ExtendScript side
118 | inside `src/host`, you will put you `jsx` files, by default I will load `index.jsx`,
119 | but I highly advise to use the session to load a `jsx` file dynamically so it can pick
120 | up it's `#include` dependencies otherwise it won't (this is a known issue)
121 |
122 | #### Webpack side
123 | so why am I using **Webpack** ?
124 | without webpack, you will have to require modules by absolute path, which is not nice,
125 | also I wanted to enjoy a better ES6 syntax.
126 |
127 | why are there separate **Webpack** configs for `client` and `session`?
128 | very good question. It boils down to the following fact, the client/front-end side, uses
129 | pure web technologies and can be bundeled with all of it's dependencies and it has a classic
130 | `web` target for webpack.
131 | the `session` side uses native node.js modules and has a `node` target in it's config, they
132 | are not to be mixed together or else subtle configuration will not work. this is equivalent
133 | to other projects using `electron`, also, it is not advisable to bundle native node.js modules,
134 | this is not efficient.
135 |
136 | #### Build scripts
137 | inside `/build-scripts`, you will find the webpack configs and also the build and deploy
138 | scripts. They use no-fancy node modules to keep things simple (no libs like Gulp).
139 |
140 | you can find:
141 | - `/build-script/build.js development/production` this will build the entire thing
142 | - `/build-script/deploy.js development/production` this will deploy the entire thing into
143 | the adobe extensions folder in debug mode currently, I still need to sign the extension
144 | - `/build-script/archive.js` this will archive the distribution in **ZXP** format, ready to be published
145 |
146 | #### FAQ
147 | **Q:** how do I add more web development modules (like redux) ?
148 | **A:** simply `npm install redux` from the root `./` directory
149 |
150 | **Q:** how do I add more session native node modules (like fs-extra) ?
151 | **A:** simply `npm install fs-extra` from the `./src/session-src` directory, when building occurs, these
152 | modules will be copied to the `./dist` folder.
153 |
154 | **Q:** how do I add some js lib without npm ?
155 | **A:** simply edit `./src/index.html`
156 |
157 | **Q:** how do I add some extendscript files ?
158 | **A:** you must add them to `./src/host/` folder and then you have two choices. one, is to edit
159 | `./assets/CSXS/manifest.xml` file to declare them, or load them at runtime dynamically (better, you can read
160 | about it more later)
161 |
162 | #### How to install
163 | - for dev mode with chrome debugging, simply `npm run release:dev`
164 | - for prod mode with **zxp** signed package, simply `npm run release:prod`, to install the zxp package,
165 | i advise the following resource:
166 | - http://install.anastasiy.com/
167 | - http://zxpinstaller.com/
168 | - https://github.com/Adobe-CEP/Getting-Started-guides/tree/master/Package%20Distribute%20Install
169 | - http://uberplugins.cc/help/how-to-install-photoshop-extension/
170 |
--------------------------------------------------------------------------------
/src/client-src/App.jsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @author Tomer Riko Shalev
3 | */
4 |
5 | import React from 'react'
6 |
7 | import Home from './comps/Home.jsx'
8 | import Debug from './comps/Debug.jsx'
9 | import Config from './comps/Config.jsx'
10 | import Upload from './comps/Upload.jsx'
11 | import Navigator from './comps/Navigator.jsx'
12 |
13 | import purple from '@material-ui/core/colors/purple';
14 | import green from '@material-ui/core/colors/green';
15 | import indigo from '@material-ui/core/colors/indigo';
16 | import pink from '@material-ui/core/colors/pink';
17 | import red from '@material-ui/core/colors/red';
18 | import orange from '@material-ui/core/colors/amber';
19 | import cyan from '@material-ui/core/colors/cyan';
20 |
21 | import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'
22 |
23 | const theme = createMuiTheme({
24 | palette: {
25 | type:'dark',
26 | primary: cyan,
27 | secondary: pink,
28 | error: red,
29 | contrastThreshold: 3,
30 | tonalOffset: 0.2,
31 |
32 | },
33 | status: {
34 | danger: 'orange',
35 | },
36 | typography: {
37 | // In Japanese the characters are usually larger.
38 | fontSize: 12,
39 | },
40 |
41 | })
42 |
43 | const styles = {
44 | root: {
45 | width: '100%',
46 | height: '100vh'
47 | }
48 | }
49 |
50 | /**
51 | * main app component
52 | *
53 | */
54 | export default class App extends React.Component {
55 | _controller = undefined
56 |
57 | constructor(props) {
58 | super(props)
59 |
60 | // controller
61 | this._controller = props.controller
62 | // navigator data
63 | this.data = [
64 | {title: 'Home', icon: 'home', comp: },
65 | {title: 'Upload', icon: 'cloud_upload', comp: },
66 | {title: 'Config', icon: 'settings', comp: },
67 | {title: 'Debug', icon: 'bug_report', comp: }
68 | ]
69 |
70 | }
71 |
72 | onNavigateChange = (index, title) => {
73 | console.log(`onNavigateChange:: ${index}, ${title}`)
74 | }
75 |
76 | /**
77 | * get controller
78 | *
79 | * @return {Controller}
80 | */
81 | get controller() {
82 | return this._controller
83 | }
84 |
85 | /**
86 | * execute the plugin
87 | *
88 | * @param {type} options description
89 | */
90 | onExecutePlugin = (options) => {
91 | console.log('App:: onExecutePlugin')
92 | // here disable UI
93 | this._controller.invokePlugin(options)
94 | // here enable ui
95 | }
96 |
97 | render() {
98 |
99 | return (
100 |
` elements.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n font-size: $font-size-base;\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n text-align: left; // 3\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `
`-`
` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\n// stylelint-disable selector-list-comma-newline-after\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: $headings-margin-bottom;\n}\n// stylelint-enable selector-list-comma-newline-after\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `
`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\n// stylelint-disable font-weight-notation\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n// stylelint-enable font-weight-notation\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so\n // we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `
` alignment by inheriting from the ``, or the\n // closest parent with a set `text-align`.\n text-align: inherit;\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: $label-margin-bottom;\n}\n\n// Remove the default `border-radius` that macOS Chrome adds.\n//\n// Details at https://github.com/twbs/bootstrap/issues/24093\nbutton {\n border-radius: 0;\n}\n\n// Work around a Firefox/IE bug where the transparent `button` background\n// results in a loss of the default `button` focus styles.\n//\n// Credit: https://github.com/suitcss/base/\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n// controls in Android 4.\n// 2. Correct the inability to style clickable types in iOS and Safari.\nbutton,\nhtml [type=\"button\"], // 1\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; // 2\n}\n\n// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box; // 1. Add the correct box sizing in IE 10-\n padding: 0; // 2. Remove the padding in IE 10-\n}\n\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n // Remove the default appearance of temporal inputs to avoid a Mobile Safari\n // bug where setting a custom line-height prevents text from being vertically\n // centered within the input.\n // See https://bugs.webkit.org/show_bug.cgi?id=139848\n // and https://github.com/twbs/bootstrap/issues/11266\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto; // Remove the default vertical scrollbar in IE.\n // Textareas should really only resize vertically so they don't break their (horizontal) containers.\n resize: vertical;\n}\n\nfieldset {\n // Browsers set a default `min-width: min-content;` on fieldsets,\n // unlike e.g. `