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

VE-2647-merge-v2-v3 #207

Merged
merged 85 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
59a6b3d
fix: (EB-430) removed extra init call to sync the data of website
contentstackMridul Nov 21, 2023
cd9d852
fix: (EB-430) removed extra init call to sync the data of website
contentstackMridul Nov 21, 2023
e8b5f4a
chore: increased the package version
contentstackMridul Nov 21, 2023
30eb32f
Merge pull request #76 from contentstack/EB-430
contentstackMridul Nov 21, 2023
3ccbac3
docs(license): update copyright year(s)
invalid-email-address Jan 1, 2024
cd5281c
Merge pull request #85 from contentstack/license/copyright-to-2024
Deepak-Kharah Jan 9, 2024
28c9ff1
fix: added sanitization on SSR input URL
contentstackMridul Feb 6, 2024
e53f629
fix: removed unsused ssr code
contentstackMridul Feb 9, 2024
2a0c034
Merge pull request #100 from contentstack/EB-430
contentstackMridul Feb 9, 2024
ec9ff41
fix: EB-(761) Live edit button doesn't go away on page navigation
contentstackMridul Feb 14, 2024
e8e3715
fix: removed commented code from test file
contentstackMridul Feb 14, 2024
0f7d8fc
Merge pull request #101 from contentstack/EB-761
contentstackMridul Feb 16, 2024
0495e3f
chore: updated license year in README file
contentstackMridul Feb 26, 2024
a93043f
chore: updated license year in README file
contentstackMridul Feb 26, 2024
a204ed4
Merge pull request #102 from contentstack/develop
contentstackMridul Feb 27, 2024
c781c4d
fix: added branch support for edit button generate url
contentstackMridul Apr 4, 2024
76d8f16
Merge pull request #115 from contentstack/EB_1270
contentstackMridul Apr 4, 2024
10cdaa2
chore: updated package json version
contentstackMridul Apr 22, 2024
d0456e1
Merge pull request #116 from contentstack/develop
contentstackMridul Apr 24, 2024
0599d7c
add: css in js support
RavenColEvol May 14, 2024
0bac3cd
add: tsup
RavenColEvol May 15, 2024
cf91a1b
fix: test cases
RavenColEvol May 15, 2024
e505f71
fix: styles with goober
RavenColEvol May 15, 2024
70b01d0
temp: skipping test for now
RavenColEvol May 15, 2024
db82309
changed: cs-live-preview-hoc from class to obj
RavenColEvol May 16, 2024
19b355a
add: react script shake support
RavenColEvol May 16, 2024
7bb0f33
chore: test webpack prod json
RavenColEvol May 16, 2024
6f41203
fix: styles to new design
RavenColEvol May 16, 2024
ee03b60
bump: package versions
RavenColEvol May 16, 2024
f4a6c49
change: webpack config to esm
RavenColEvol May 17, 2024
93fe1da
fix: goober to be treeshaken
RavenColEvol May 17, 2024
130d4a2
add: page compare util
RavenColEvol May 17, 2024
ce1a650
fix: post robot test cases
RavenColEvol May 17, 2024
5e8deb1
fix: class names to cs-compare
RavenColEvol May 17, 2024
e76cc8e
add: cs-compare custom component to reduce css conflict
RavenColEvol May 20, 2024
ec7c921
fix: add conditional check to only register custom component once
RavenColEvol May 20, 2024
4d66f4c
fix: custom element extends
RavenColEvol May 23, 2024
261f52d
add: page travel with anchor to update with query params
RavenColEvol May 23, 2024
7c15b22
fix: removed headers key from SDK init data as it no longer supports …
contentstackMridul May 28, 2024
906be06
Merge pull request #132 from contentstack/VE_1541
contentstackMridul May 28, 2024
04c5da6
fix: edit button was removed from document because of nextjs router p…
contentstackMridul May 30, 2024
17ae24d
Merge pull request #135 from contentstack/VE_1522
contentstackMridul May 31, 2024
cdf86e9
remove: live editing css import
RavenColEvol Jun 3, 2024
550512c
chore: bump version to 2.0.0
RavenColEvol Jun 11, 2024
f7eb135
Merge pull request #136 from contentstack/VE-1931
KANE-99 Jun 18, 2024
d47fc72
sca-scan.yml
aravindbuilt Jun 18, 2024
fa25902
jira.yml
aravindbuilt Jun 18, 2024
71836b4
sast-scan.yml
aravindbuilt Jun 18, 2024
301829d
codeql-analysis.yml
aravindbuilt Jun 18, 2024
49b76d4
Update README.md
KANE-99 Jun 18, 2024
0d67245
Merge pull request #141 from contentstack/KANE-99-patch-1
KANE-99 Jun 18, 2024
583d08b
fix: add version bump in package json
KANE-99 Jun 18, 2024
402f9f6
Merge pull request #142 from contentstack/bump-version-for-readme-update
KANE-99 Jun 18, 2024
794f7d6
Merge branch 'develop' of github.com:contentstack/live-preview-sdk in…
contentstackMridul Jun 20, 2024
923af60
fix: updated code version for v2 type version
contentstackMridul Jun 20, 2024
f2ee8f2
sca-scan.yml
aravindbuilt Jun 25, 2024
3f7f87d
jira.yml
aravindbuilt Jun 25, 2024
5417eaa
sast-scan.yml
aravindbuilt Jun 25, 2024
f0fc3cb
codeql-analysis.yml
aravindbuilt Jun 25, 2024
aed4a2e
Merge branch 'main' into main-tem
aravindbuilt Jun 25, 2024
5d7081f
Merge pull request #137 from contentstack/develop
contentstackMridul Jun 25, 2024
c1ae13d
Merge pull request #145 from contentstack/main-tem
contentstackMridul Jun 25, 2024
e1d3ed2
fix: removed code for default branch
contentstackMridul Jul 8, 2024
e8170fd
test: fix the test cases
contentstackMridul Jul 8, 2024
ea67b13
Merge pull request #161 from contentstack/VE_2262
contentstackMridul Jul 9, 2024
dc099d3
chore: updated the readme for new initialization for HTML code
contentstackMridul Jul 9, 2024
c942196
Merge branch 'develop' of github.com:contentstack/live-preview-sdk in…
contentstackMridul Jul 9, 2024
953ac72
chore: updated package version for v2
contentstackMridul Jul 9, 2024
8ff505f
Merge pull request #162 from contentstack/VE_2262_2
contentstackMridul Jul 9, 2024
81ab2db
feat: add remove-diff listener to toggle highlight diff
KANE-99 Jul 17, 2024
cf39bf6
chore: uncomment mustache
KANE-99 Jul 17, 2024
76c4078
chore: update mustache readme
KANE-99 Jul 17, 2024
c042af1
chore: uncomment mustache script
KANE-99 Jul 17, 2024
b24ecc6
chore: bump version to 2.0.3
KANE-99 Jul 17, 2024
7da72d8
Merge pull request #170 from contentstack/VE-2277-highlight-differenc…
contentstackMridul Jul 22, 2024
ed6730f
Merge branch 'main' into develop_v2
contentstackMridul Jul 22, 2024
c6c4d04
Merge pull request #164 from contentstack/develop_v2
contentstackMridul Jul 22, 2024
6398195
chore: update dependencies from v2
Deepak-Kharah Aug 27, 2024
c0b1a5d
chore: update classnames to builder
Deepak-Kharah Aug 28, 2024
0dfb717
chore: sync timeline changes
Deepak-Kharah Aug 29, 2024
1bf2f8a
chore: sync url change changes
Deepak-Kharah Aug 29, 2024
d3220f7
chore: sync preview module
Deepak-Kharah Aug 29, 2024
9de5417
chore: sync hoc
Deepak-Kharah Aug 29, 2024
9c940e8
Merge remote-tracking branch 'origin/main' into VE-2647-merge-v2-v3
Deepak-Kharah Aug 29, 2024
5f62635
Merge remote-tracking branch 'origin/VC-115/live-editor-support' into…
Deepak-Kharah Sep 3, 2024
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
8 changes: 5 additions & 3 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ module.exports = {
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/ban-ts-comment": 0,
"prefer-rest-params": 0,
// warn for unused vars but not for unused funciton params prefixed with _
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-empty-function": 0,
},
};
};
7 changes: 6 additions & 1 deletion .github/workflows/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
types: [opened]
jobs:
security:
security-jira:
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
runs-on: ubuntu-latest
steps:
Expand All @@ -26,3 +26,8 @@ jobs:
PR: ${{ github.event.pull_request.html_url }}

fields: "${{ secrets.JIRA_FIELDS }}"
- name: Transition issue
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.create.outputs.issue }}
transition: ${{ secrets.JIRA_TRANSITION }}
11 changes: 11 additions & 0 deletions .github/workflows/sast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: SAST Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-sast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Semgrep Scan
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config auto
2 changes: 1 addition & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security:
security-sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx ts-node mustache.ts
npx ts-node --esm mustache.ts
git add .
npx lint-staged
npx lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
npm test
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"useTabs": false,
"bracketSpacing": true
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2023 Contentstack
Copyright (c) 2021-2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,19 @@ npm install @contentstack/live-preview-utils
Alternatively, if you want to include the package directly in your website HTML code, use the following command:

```html
<script src="https://unpkg.com/@contentstack/[email protected]/dist/index.js"></script>
<script type='module'>
import ContentstackLivePreview from 'https://esm.sh/@contentstack/[email protected]';

ContentstackLivePreview.init({
stackDetails: {
apiKey: "your-stack-api-key",
},
});
</script>
```
> [!NOTE]
> This step involves incorporating the package into your HTML code and initializing it, eliminating the need for re-initialization in the subsequent step.


# Initializing the SDK

Expand All @@ -35,33 +46,12 @@ ContentstackLivePreview.init({
});
```

Alternatively, if you want to initialize the SDK directly inside the HTML tag, use the ContentstackLivePreview.init() method as follows:

```html
<script>
ContentstackLivePreview.init({
stackDetails: {
apiKey: "your-stack-api-key",
},
});
</script>
```

# [Live Editing](https://www.contentstack.com/docs/developers/set-up-live-preview/set-up-live-preview-for-your-website/#live-editing-for-entries-optional-)

Live Preview provides edit tags that allow you to edit your content in real-time. Live edit tags are identified as the data-cslp attribute within the HTML tags. The styles for the live edit tags are available in the @contentstack/live-preview-utils/dist/main.css file.

To use live edit tags within your stack, you need to include them in your main index.js file as follows:

```javascript
import "@contentstack/live-preview-utils/dist/main.css";
```

# License

MIT License

Copyright © 2021 [Contentstack](https://www.contentstack.com/). All Rights Reserved
Copyright © 2024 [Contentstack](https://www.contentstack.com/). All Rights Reserved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
13 changes: 5 additions & 8 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
module.exports = {
testEnvironment: "jsdom",
roots: ["<rootDir>/src"],
testMatch: [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)",
],
automock: false,
setupFiles: ["<rootDir>/setupJest.ts"],
testEnvironment: "jsdom",
transform: {
"^.+\\.tsx$": "babel-jest",
"^.+\\.ts$": "ts-jest",
preset: "ts-jest",
moduleNameMapper: {
uuid: require.resolve("uuid"),
},
coveragePathIgnorePatterns: ["__test__/"],
collectCoverage: true,
coverageReporters: ["html"],
moduleNameMapper: {
"^lodash-es$": "lodash",
},
};
};
36 changes: 13 additions & 23 deletions main.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,19 @@ npm install @contentstack/live-preview-utils
Alternatively, if you want to include the package directly in your website HTML code, use the following command:

```html
<script src="https://unpkg.com/@contentstack/live-preview-utils@{{packageVersion}}/dist/index.js"></script>
<script type='module'>
import ContentstackLivePreview from 'https://esm.sh/@contentstack/live-preview-utils@{{packageVersion}}';

ContentstackLivePreview.init({
stackDetails: {
apiKey: "your-stack-api-key",
},
});
</script>
```
> [!NOTE]
> This step involves incorporating the package into your HTML code and initializing it, eliminating the need for re-initialization in the subsequent step.


# Initializing the SDK

Expand All @@ -35,33 +46,12 @@ ContentstackLivePreview.init({
});
```

Alternatively, if you want to initialize the SDK directly inside the HTML tag, use the ContentstackLivePreview.init() method as follows:

```html
<script>
ContentstackLivePreview.init({
stackDetails: {
apiKey: "your-stack-api-key",
},
});
</script>
```

# [Live Editing](https://www.contentstack.com/docs/developers/set-up-live-preview/set-up-live-preview-for-your-website/#live-editing-for-entries-optional-)

Live Preview provides edit tags that allow you to edit your content in real-time. Live edit tags are identified as the data-cslp attribute within the HTML tags. The styles for the live edit tags are available in the @contentstack/live-preview-utils/dist/main.css file.

To use live edit tags within your stack, you need to include them in your main index.js file as follows:

```javascript
import "@contentstack/live-preview-utils/dist/main.css";
```

# License

MIT License

Copyright © 2021 [Contentstack](https://www.contentstack.com/). All Rights Reserved
Copyright © 2024 [Contentstack](https://www.contentstack.com/). All Rights Reserved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
6 changes: 3 additions & 3 deletions mustache.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// index.js
// import { render } from 'mustache';
import {render} from 'mustache';
import * as mustache from 'mustache';
import { readFile, writeFileSync } from 'fs';
import packageJson from "./package.json";
import packageJson from "./package.json" assert { type: "json" };
const MUSTACHE_MAIN_DIR = './main.mustache';
/**
* DATA is the object that contains all
Expand All @@ -15,7 +15,7 @@ const DATA = {
function generateReadMe() {
readFile(MUSTACHE_MAIN_DIR, (err, data) => {
if (err) throw err;
const output = render(data.toString(), DATA);
const output = mustache.default.render(data.toString(), DATA);
writeFileSync('README.md', output);
});
}
Expand Down
Loading
Loading